Hi all!
Trying to get fullscreen screenshots for my AppGameKit projects has been an issue for a while now; on my Win 7 the PrtScr button only seems to capture the screen render from the first time through the loop, which is pretty much useless.
I've noticed some other people having similar issues, so I tried my hand at making some code to save high res, fullscreen screenshots from an AppGameKit app.
I used GetMaxDeviceWidth/Height() for everything, but you should be able to change that (within the screenshot section) to just GetDeviceWidth/Height() or whatever variables you're using for screen/virtual resolution without any problems. If there are any issues with the resolution or text scaling, just let me know.
I've attached the screenshot code as a code snippet along with some example screenshots and a small demo (with code) that will hopefully be able to help out anybody who's having the same issues with PrtScr.
It seems to work just fine on my computer, but I'd like to get feedback from you guys as well; let me know how it works on your computers or if there's any problems that you run into so I can try to patch them up.
The demo is physics based with pretty standard first-person controls, and the other controls are all being printed on screen.
Hopefully this is helpful to someone,
Ciao!
PS. All media found in this demo was made by myself and is free to use for everyone.
if GetRawKeyPressed(80) // P to screenshot
DeleteText(saveText)
number = 1
Render()
screenGrab = GetImage(0, 0, GetMaxDeviceWidth(), GetMaxDeviceHeight())
checkFiles:
if GetFileExists("raw:"+GetReadPath()+"screenshots/Screenshot"+str(number)+".png")
number = number + 1
goto checkFiles
endif
SaveImage(screenGrab, "raw:"+GetReadPath()+"screenshots/Screenshot"+str(number)+".png")
saveText = CreateText("Image saved as Screenshot"+str(number)+".png in "+ GetReadPath()+"screenshots")
SetTextSize(saveText, GetMaxDeviceHeight() * 0.0275)
textTimer = 1
endif
If textTimer > 0 Then textTimer = textTimer + 1
If textTimer = 300
DeleteText(saveText)
textTimer = 0
EndIf