|
-
Feb 5th, 2002, 05:54 AM
#1
Thread Starter
Junior Member
Screenshots
- Right, I've given up on trying to work this out myself, so I'm going to post this all over the place and try to get some feedback off you guys...
THE PROGRAM:
Its a 3D game engine thingy. I wrote it in VB6 with my mate and then we converted it to C++. Its very nice, but has to be in C++ when you start using HUGE terrains like what we are.
THE PROBLEM:
I need to be able to take screenshots and I can't. I'm guessing that games do it by blitting the game window to an area of memory and then saving it or something?
I can't just use Print Screen cos my DirectInput is in foreground (or background... well, the one that stops Print Screen anyway).
All answers in Vis Basic or C++, I really don't mind, just so long as it works!
Thanks!
FJ
And yes, I have posted this message in tons of places. Not sure if its supposed to be in C++, VB, Games and Graphics or the API section. Maybe we should start a thread to discuss this (or maybe not).
100% of drink driving incidents are alcohol related.
-
Feb 6th, 2002, 01:01 PM
#2
This will save the screen as a bitmap. Hope this helps.
VB Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_SNAPSHOT = &H2C
Private Function SaveScreen(ByVal theFile As String) As Boolean
On Error Resume Next
'To get the Entire Screen
Call keybd_event(vbKeySnapshot, 1, 0, 0)
'To get the Active Window
'Call keybd_event(vbKeySnapshot, 0, 0, 0)
SavePicture Clipboard.GetData(vbCFBitmap), theFile
SaveScreen = True
Exit Function
End Function
'Usage
Call SaveScreen("C:\Windows\Desktop\shot1.bmp")
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
|