a good DX screen capture function...
Anyone have a cool function in directX to capture a screen and write it out to say a .bmp file? I tried to use prtscn and it screwed up my pallets, I only ask because I dont want to reinvent the wheel if someone has one already...
Thanks
-Shane
p.s.if you do post or mail me it, thanks.
August 28, 2001 08:17 AM
I am looking for Dx screen capture function a long time. if you have, can you give me ?
Ok guys, have fun:
Here are two ways to accomplish what you need. The first is by writing your ddsurface to a bitmap file. You call SaveBMP and pass it the surface to save, your primary buffer if you are in 8 bit mode so the palette can be accessed, and the filename. It then calls SaveBMPToFile, which does exactly what it says on the tin. Note, I did not write these two functions, but received it here in much the same manner you are. I''ve tested them for 32 and 24 bit mode, not 16 or 8, so they may not work.
In that case try using the following function, which I did write.
This function copies any surface to the clipboard, as a bitmap, which you can then paste into any paint-like program. Note this hasn''t been tested for 8 bit mode either, so you might get wierd effects when pasting if you run your windows os at 256 colours (it may conform the bitmap to the nearest colour on the windows palette). Anyway, here''s the code:
Good luck with your work
ps. please check out my recent post to see if you know of the game/developer I am looking for: it''s here. Thanks.
r.
"The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."
Here are two ways to accomplish what you need. The first is by writing your ddsurface to a bitmap file. You call SaveBMP and pass it the surface to save, your primary buffer if you are in 8 bit mode so the palette can be accessed, and the filename. It then calls SaveBMPToFile, which does exactly what it says on the tin. Note, I did not write these two functions, but received it here in much the same manner you are. I''ve tested them for 32 and 24 bit mode, not 16 or 8, so they may not work.
|
In that case try using the following function, which I did write.
This function copies any surface to the clipboard, as a bitmap, which you can then paste into any paint-like program. Note this hasn''t been tested for 8 bit mode either, so you might get wierd effects when pasting if you run your windows os at 256 colours (it may conform the bitmap to the nearest colour on the windows palette). Anyway, here''s the code:
|
Good luck with your work

ps. please check out my recent post to see if you know of the game/developer I am looking for: it''s here. Thanks.
r.
"The mere thought hadn''t even begun to speculate about the slightest possibility of traversing the eternal wasteland that is my mind..."
An easier and less complicated way is found here. There is no reason to loop thru all the bytes and write em out for each color depth. GDI can do it for you.
Using the GDI to Take DirectDraw Screenshots
-Mod
Using the GDI to Take DirectDraw Screenshots
-Mod
----------------------
Modian
Modian
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement