【发布时间】:2014-10-25 20:07:10
【问题描述】:
我正在 Windows Mobile 上测试几种屏幕捕获功能的实现。
使用 SO,我通过 @ctacke 使用 OpenNetCF.Drawing 库 (http://blog.opennetcf.com/2009/03/11/screen-capture-in-the-compact-framework/) 找到了以下方法:
// create a bitmap and graphics objects for the capture
Drawing.Bitmap destinationBmp = new Drawing.Bitmap(Forms.Screen.PrimaryScreen.Bounds.Width, Forms.Screen.PrimaryScreen.Bounds.Height);
Drawing.Graphics g = Drawing.Graphics.FromImage(destinationBmp);
GraphicsEx gx = GraphicsEx.FromGraphics(g);
// capture the current screen
gx.CopyFromScreen(0, 0, 0, 0, Forms.Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
// save the file
destinationBmp.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
// clean house
gx.Dispose();
g.Dispose();
destinationBmp.Dispose();
我尝试在 Windows Mobile 6.5 VGA Emulator 上的一个简单应用程序上测试此方法并获得无人参与的结果:
保存的图像大小正确(480x640),但内容不是我屏幕的完整副本:缺少标题部分,底部是“黑色填充”(缺少的像素线是黑色的)。
在 Windows Mobile 6 模拟器上尝试,遇到了同样的问题。如何获取全屏?
【问题讨论】:
标签: windows-mobile windows-mobile-6.5 opennetcf