当我对 Windows 7 当前屏幕进行屏幕截图时,生成的图像在 300kb 到 3.5MB 之间。是什么导致相同屏幕尺寸和相同质量的尺寸变化如此之大?又该如何避免呢?
这是我使用的简单代码:
int screenWidth = Screen.GetBounds(new System.Drawing.Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new System.Drawing.Point(0, 0)).Height;
System.Drawing.Bitmap bmpScreenShot = new System.Drawing.Bitmap(screenWidth, screenHeight);
System.Drawing.Graphics gfx = System.Drawing.Graphics.FromImage((System.Drawing.Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new System.Drawing.Size(screenWidth, screenHeight));
bmpScreenShot.Save(@"C:\\Snap.png", System.Drawing.Imaging.ImageFormat.Png);