SavepixmapPNG - broken?

Archives Forums/BlitzMax Bug Reports/SavepixmapPNG - broken?

Sonic(Posted 2008) [#1]
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!


GfK(Posted 2008) [#2]
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?


Sonic(Posted 2008) [#3]
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.


GfK(Posted 2008) [#4]
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).


Beaker(Posted 2008) [#5]
Doesn't save a file at all?
Saves a blank 640x480 image?
Something else?

Are you doing it before or after a Flip? Fullscreen?


Sonic(Posted 2008) [#6]
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.


GfK(Posted 2008) [#7]
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.


Beaker(Posted 2008) [#8]
More here:
Click