Function savescreenshot(slot)
Local Screen:Timage = CreateImage(640,480)
GrabImage(Screen,0,0)
Local Screentemp:TPixmap = LockImage(Screen)
Local Savedpic=SavePixmapPNG(Screentemp,"save/"+String(slot)+".png")
End Function
This works as a stand-alone program, but ingame does nothing - 'Savedpic' seems to return true...
Please help!
What do you mean by "does nothing"?
Doesn't save a file at all?
Saves a blank 640x480 image?
Something else?
Also, why are you using CreateImage/GrabImage then converting that to a pixmap when GrabPixmap will do the same thing in one function?
Oh I've tried it both ways, just wanted to see. Point is it works in standalone program. I'm also using no custom GL / DX in-game, on a Mac.
I'm trying to save the back-buffer.
SavePixmapPNG always returns true. In standaone program it saves the image, in the game it saves nothing.
on a Mac
Its these nuggets of knowledge that should appear in your first post.
Since I don't own a Mac I can't test or offer any help with this (other than recommend you use GrabPixmap anyway).
Doesn't save a file at all?
Saves a blank 640x480 image?
Something else?
Are you doing it before or after a Flip? Fullscreen?
Found a solution -but it's hacky:
Local Screentemp:TPixmap = GrabPixmap(0,0,640,480)
Screentemp = GrabPixmap(0,0,640,480)
Local Savedpic=SavePixmapPNG(Screentemp,"save/"+String(slot)+".png")
GrabPixmap x 2 seems to work... Maybe it's some kind of triple-buffer issue? Who knows.
That's interesting.
GrabImage/GrabPixmap not working has been reported before, very recently, and once before that about a year ago. Didn't realise it effected the Mac version too.
This seriously needs looking into.