MikeHart
Administrator
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Target Dev
3rd Party Tool Dev
- Joined
- Jun 19, 2017
- Messages
- 3,564
This little module will let you save the content of a canvas to either a PNG, JPG or BMP file.
A little test programm is basically self explaining. About its usage. The relevant part is this:
Just copy the content into your mojo2 powered game.
If you find any issues, please let me know in this thread.
Disclaimer: Tested only on Windows.
A little test programm is basically self explaining. About its usage. The relevant part is this:
Cerberus:
Import saveImage
'...
Local file := RequestFile("Save file....", "Image Files:png,jpg,bmp;All Files:*", True)
Local ext:=filepath.ExtractExt(file).ToLower()
Select ext
Case "png"
SavePNG(file, canvas)
Case "bmp"
SaveBMP(file,canvas)
Case "jpg" ' SaveJPG needs a quality value with a range of 1-100
SaveJPG(file,canvas,50)
End
Just copy the content into your mojo2 powered game.
If you find any issues, please let me know in this thread.
Disclaimer: Tested only on Windows.