0

Why the screenshot does not copy until the edge of my screen?

Is there code that can detect windows scaling? My laptop is scaled at 150%. My actual resolution is at 1920 x 1080, but C# detects only 1820 x 720

enter image description here

Bitmap bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);

Graphics g = Graphics.FromImage(bmp);
g.CopyFromScreen(
   Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0,
   0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Servy
  • 202,030
  • 26
  • 332
  • 449

0 Answers0