Skip to main content
gamedev.net
🔒 Locked

Screenshots...

Started by CProgrammer 8 replies 400+ views
Original Post
CProgrammer
CProgrammer
Could someone please help me. How can i make a screenshot of a running directx app. If someone could give a short peace of code, preferably using HBITMAP if possible or CBitmap i''d be more than happy. -CProgrammer
Pipo DeClown
Pipo DeClown
Quickest way:

-Run game;
-Go to the place for screenshot;
-Press Printscreen on your keyboard(above the Insert key);
-Quit game;
-Run Paint(or other graphics editors);
-Press CTRL + V(paste);

EDIT~ OMG i thought it was perfect.

.lick

[edited by - Pipo DeClown on January 1, 2003 10:12:37 AM]
CProgrammer
CProgrammer
Thanks, after having changed my DirectInput flag to NONEXCLUSIVE that worked.
That''ll do for my personal screenshots, but if anyone can give me code that will save the screen to a HBITMAP Handle please post it.
Thanks
-CProgrammer
Pseudo
Pseudo
If you''re using DirectDraw (maybe even D3D if you actually get the primary surface), then I think I remember there being a function that gives you a device context for a surface. Call this on the primary surface, then look in MSDN for the Win32 function that saves a memory DC (device context) as a bitmap. That should do it. Sorry I''m too lazy to look up the function names for you, but they exist so just look them up in the docs.
HunterTKilla
HunterTKilla
Theres an article about doing this on Gamedev,

http://www.gamedev.net/reference/articles/article1844.asp
CProgrammer
CProgrammer
Sorry for not replying for so long i wasn''t at home.
Just wanted to say thanks to everybody.
-CProgrammer

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.