|
-
August 1st, 2003, 12:18 PM
#8
Originally posted by galathaea
I think DirectDraw is probably the nicest solution for this. You DirectDrawCreateEx your IDirectDraw7 interface, set it up to support your primary surface (SetCooperativeLevel, etc.), and then you can use one of the many ways to actually create your IDirectDrawSurface7 object. The trick here is that you want to have your primary surface represent the one that GDI uses, and there are two commands that allow you access to the GDI primary surface (GetGDISurface and FlipToGDISurface), or if there is a specific DC you know you want access to, use that (unfortunately, I don't have experience with this yet, so I can't give much details). You should then create a back buffer surface as well. Then, you can BltFast from the primary surface to the buffer any time you want to capture the screen and Lock the buffer surface to give you memory access to the actual bitmap bits (which will be in a device dependent format, which you need to parse using the information from the DDSURFACEDESC2 structure returned to you when you lock the surface).
There was an interesting post in this forum a couple of weeks back by LearnMFC, with several people (including myself) trying to help with a problem very similar. Its title mentioned getting access to a bitmap's bits a particular Hz, so if you find that, maybe it can give some more ideas!
I usually use both hand to grab the screen, this due to drunkeness (sp is that a freaking word?) word up bro....
and andreas was asking what ThreadJacking was..phhhppt...
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
|