In order to create a screen shot, I am hiding a wpf window. The code looks like that.
Hide();
var fullScreenshot = _cropper.TakeFullScreenshot();
Show();
Sometimes the Application is not hidden when the screen shot is taken. How can I can I identify, that the window is completely hidden?
I don’t know how the screenshot is taken but I suspect that the UI-Thread has not removed all the content and therefore the
TakeFullScreenshotsees rests of your app.I would try to wait until your app has done all necessary ui-work and then trigger the
TakeFullScreenshot-operation.Trigger the ScreenShot-Operation with the
Dispatcher: