@@ -400,6 +400,16 @@ Class Pixmap
Return New Pixmap( width,height,_format,PixelPtr( x,y ),_pitch )
End
+ #rem monkeydoc Saves the pixmap to a file.
+
+ The only save format currently suppoted is PNG.
+ #End
+ Method Save:Bool( path:String )
+ Return SavePixmap( Self,path )
+ End
#rem monkeydoc Loads a pixmap from a file.
@param path The file path.
@@ -2,6 +2,8 @@
Namespace std
#Import "<libc.monkey2>"
+#Import "<stb-image>"
+#Import "<stb-image-write>"
#Import "collections/container"
#Import "collections/stack"
@@ -29,6 +31,7 @@ Namespace std
#Import "graphics/pixelformat"
#Import "graphics/pixmap"
#Import "graphics/pixmaploader"
+#Import "graphics/pixmapsaver"
#Import "graphics/color"
#Import "misc/random"