Screenshot from form
I want to get screenshot of screen under my fo开发者_如何学运维rm, 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.
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?
精彩评论