Saving Images

BlitzMax Forums/BlitzMax Programming/Saving Images

RJJ(Posted 2005) [#1]
How can I save a pixmap as a file. I'd like to save it as as JPG, TGA, etc. Is the possible with Max natively? Has anyone ported FreeImage yet ?

Thanks
RJJ


Perturbatio(Posted 2005) [#2]
The PNG Loader module has a SavePixmapPng function, I don't know what other formats have a save yet.


Sensenwerk(Posted 2005) [#3]
Uhm... it says "Identifier not found" when trying to save a pixmap using SavePixmapPNG.


Perturbatio(Posted 2005) [#4]
Identifier not found suggests you are using a non-existant variable.


Sensenwerk(Posted 2005) [#5]
It says: Identifier 'SavePixmapPNG' not found.
Try it yourself.
LoadPixmap doesn't work, too.


Perturbatio(Posted 2005) [#6]
This works for me:
SetGraphicsDriver(GLMax2DDriver()) 
Graphics 640,480,0,0

Global myPixmap : TPixmap

While Not KeyDown(1)
Cls
DrawRect(10,10,100,100)

Flip

If KeyHit(KEY_P) Then myPixmap = GrabPixmap(0,0,640,480)
If KeyHit(KEY_S) Then SavePixmapPNG(myPixmap, "c:\myimage.png")

Wend

End




amonite(Posted 2005) [#7]
It's a bit old but you might find it interresting to look at :
http://www.blitzbasic.com/Community/posts.php?topic=41965