Regarding Screen changes
-
Hi, Iam Using VC++, Iam planning to capture the screen, saving into .BMP format and iam able to do this. My question is I want to capture the screen whenever the changes happen on my desktop. Can any one tell me how do i know whether the screen changed or not. i mean through which event we can find it out. Thanks in Advance. Regards Santosh.K
-
Hi, Iam Using VC++, Iam planning to capture the screen, saving into .BMP format and iam able to do this. My question is I want to capture the screen whenever the changes happen on my desktop. Can any one tell me how do i know whether the screen changed or not. i mean through which event we can find it out. Thanks in Advance. Regards Santosh.K
If you wish to capture the screen when even a single pixel has changed you'll have an impossible time finding an event which triggers that. Suppose you have a movie running on the screen. The screen changed but probably not a single message is called. In this case your best bet would be to keep capturing the screen on a certain interval and comparing the bitmaps in memory. This would be really slowing down your system though. If you don't mind much about movies and the like and wish to recapture only when a window for instance resizes or gets created you could make a global windows hook. A CBT hook would be quite good for this purpose I guess. From the MSDN: The system calls this function before activating, creating, destroying, minimizing, maximizing, moving, or sizing a window; before completing a system command; before removing a mouse or keyboard event from the system message queue; before setting the keyboard focus; or before synchronizing with the system message queue.
-
Hi, Iam Using VC++, Iam planning to capture the screen, saving into .BMP format and iam able to do this. My question is I want to capture the screen whenever the changes happen on my desktop. Can any one tell me how do i know whether the screen changed or not. i mean through which event we can find it out. Thanks in Advance. Regards Santosh.K
The best thing you can do in this case I guess is to capture the screen at a static interval. You can do three things (which I can think of atleast :)): 1) Just capture the screen at a static interval and write it to the disk as bitmap 2) Capture the screen at a static interval and write it to the disk as a compressed image 3) Capture the screen and compare it to the last to see if it changed and write it to the disk if it didn't (this means that you'll also have to keep a log on how long the same image should be shown) Depending on the desired framerate and quality of the final movie (and ofcourse speed of the machine) I can't do nothing but suggest you to find the best and fastest way for yourself. They all have disadvantages, the first two being a high I/O and the second a lot of CPU required. The third, well I don't know about performance in the third. It seems like it could be pretty fast compared to the other two, but it's just a hunch :) I think though that if you want the best performance this should be done in assembly, especially with method 2 and 3. And I was just thinking. Suppose you have a resolution of 1024x768, 16 bits and you wish to have a framerate of 24. This means that with method 1 you'll have to write about 40MB/s to the harddisk. It's going to have a very hard time doing that and the harddisk will need quite some space too :) If I were you I'd try my last suggestion, it sure seems like the most fun suggestion as well :)