August 29th, 2011, 02:55 PM
#1
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!
August 29th, 2011, 03:10 PM
#2
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!
September 2nd, 2012, 07:30 AM
#3
Re: Quick Screen Capture in MFC?
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.
August 29th, 2011, 03:22 PM
#4
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?
August 29th, 2011, 03:34 PM
#5
Re: How do you know when Invalidate(true) is done?
Why are you starting duplicate threads?
Invalidate(TRUE);
UpdateWindow();
CaptureScreen(ScreenCounter);
August 29th, 2011, 04:11 PM
#6
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.
September 7th, 2011, 09:06 AM
#7
Re: Quick Screen Capture in MFC?
Try to call UpdateWindow after your Invalidate.
September 7th, 2011, 09:08 AM
#8
Re: Quick Screen Capture in MFC?
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width
Bookmarks