表格截图
我想获取表单下的屏幕截图,所以我先隐藏它并在捕获后显示。但在我的 Windows 7 上,表单并未完全最小化,因此我在屏幕截图中获取了表单。我如何确保我的表单完全最小化?
WindowState = FormWindowState.Minimized;
Bitmap screenshot = ScreenUtils.ScreenShot();
background = screenshot;
WindowState = FormWindowState.Normal;
PS Hide() 和 Show() 也有同样的问题。
I want to get screenshot of screen under my form, so I hide it first and show after capturing. But on my Windows 7 form is not completely minimize, so I get form on screenshot. How can I be sure that my form is competely minimize?
WindowState = FormWindowState.Minimized;
Bitmap screenshot = ScreenUtils.ScreenShot();
background = screenshot;
WindowState = FormWindowState.Normal;
P.S. Hide() and Show() have the same problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将表单不透明度设置为 0,调用刷新以确保绘画完成,捕获,将不透明度重置为 1,然后再次调用刷新
you could set your forms opacity to 0, call refresh to make sure the painting is done, capture, reset opacity to 1 and call refresh again
您是否尝试在进行屏幕截图之前先睡一觉?
Did you try to build in a sleep before making a screenshot?