Quick Screen Capture in MFC?
I've got a screen capture method that captures the screen and saves to a BMP but it seems slow. That is to say, it works fine for the first 2 screen capture events but for the next 2 it doesn't capture the updates, but rather captures the same previous image.
Does anybody have a handy-dandy real fast screen capture to BMP method?
Thanks in advance!
Re: Quick Screen Capture in MFC?
I just wanted to follow up.
This isn't my posting, but this is exactly the same problem that I'm having:
http://stackoverflow.com/questions/4...235308#7235308
It appears that the code isn't slow, it's a matter of 'thread synchronization'.
Specifically, my code looks like this:
Invalidate(true);
CaptureScreen(ScreenCounter);
And the screen capture is happening before the screen is 'rebuilt' from the Invalidate.
How do I ensure that that CaptureScreen is called only after Invalidate(true) is finished?
Thanks!
How do you know when Invalidate(true) is done?
How do you know when Invalidate(true) is done? (yeah, I know, the screen has been updated).
The problem that I'm having is this code:
Invalidate(true);
CaptureScreen(ScreenCounter);
Unfortunately, the screen capture is happening BEFORE the screen has been updated. Is there some way that I can force a 'wait' until Invalidate(true) is done?
Re: How do you know when Invalidate(true) is done?
Why are you starting duplicate threads?
Invalidate(TRUE);
UpdateWindow();
CaptureScreen(ScreenCounter);
Re: How do you know when Invalidate(true) is done?
Thanks! That worked a charm!
Sorry about the duplicate threads. My first thread was about a screen capture, and the second was more specific.
Again, sorry about the duplicate threads.
Really appreciate the help.
Re: Quick Screen Capture in MFC?
Try to call UpdateWindow after your Invalidate.
Re: Quick Screen Capture in MFC?
Re: Quick Screen Capture in MFC?
Quote:
Originally Posted by
zetar
I just wanted to follow up.
This isn't my posting, but this is exactly the same problem that I'm having:
http://stackoverflow.com/questions/4...235308#7235308
It appears that the code isn't slow, it's a matter of 'thread synchronization'.
Specifically, my code looks like this:
Invalidate(true);
CaptureScreen(ScreenCounter);
And the screen capture is happening before the screen is 'rebuilt' from the Invalidate.
How do I ensure that that CaptureScreen is called only after Invalidate(true) is finished?
Thanks!
but it seems don't work when the surface show in overlay.