为什么屏幕截图直到屏幕边缘才会复制?

时间:2017-06-26 05:55:28

标签: c# screenshot scale scaling

为什么屏幕截图直到屏幕边缘才会复制?

是否有可以检测Windows缩放的代码?我的笔记本电脑的比例为150%。我的实际分辨率为1920 x 1080,但C#仅检测到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);

0 个答案:

没有答案