Skip to main content
gamedev.net
🔒 Locked

Print Screen

Started by vbisme 3 replies 200+ views
Original Post
vbisme
vbisme
If I try to print the screen using the Print Screen key, when could I find the image file?
invective
invective
Pushing print screen in windows does not save a snapshot to the disk -- it copies the contents of the screen to the clip board (alt+print screen copies only the current window). You need to open an image editing program (mspaint.exe will do) and paste the image in with ctrl+v or edit paste, then save the file.
Sturm
Sturm
If you are using DX why not simply catch the PrintScreen event, and then save your buffer to either clipboard or a file?

See Screen Shots here on GD.NET for an exapmle (Haven''t tested that one though)

-- Sturm

---------------------------------------------------
Life after death? No thanks, I want to live NOW
--- Sturm 2001
---------------------------------------------------Life after death? No thanks, I want to live NOW --- Sturm 2001
KalvinB
KalvinB
The AP one works great.

You just need to add

    
#include <windows.h>
#include <stdio.h>

HRESULT SaveBitmap( char strFileName[128], PBITMAPINFO pbi, HBITMAP hBMP, HDC hDC );
int g_iSnapshotBitmapNumber,g_iScreenWidth=800, g_iScreenHeight=600;


to the beginning of the file and then you can include it in any project. You can force a 24 bit screenshot by removing the checks for the actual bitdepth and changing the bmiHeader.bitcount to 24.

http://therabbithole.redback.inficad.com/tricks/downloads/screenshot.cpp

is a fixed version that allows you to pass the DX surface, the width and the height allowing you to capture any surface at any size at 24bits per pixel with one call:

  
HRESULT TakeSnapshot( LPDIRECTDRAWSURFACE7 surface, short g_iScreenWidth, short g_iScreenHeight)


Ben



Edited by - KalvinB on November 29, 2001 1:33:13 PM

Topic Locked

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

Sign in to reply to this topic.