Create a .png image file?

Is it possible to create a simple image file using tools like iOSGraphics has? (line, rectangle, fill, text)
I would like to be able to save this as a .png and email it or save to pictures etc.

http://developer.xojo.com/iosbitmap (to use the iosGraphics), get from that a iosImage (image property)
http://developer.xojo.com/iosimage the method writeToFile

This worked great! Thank you!

Another question…
Is there a way to send this file directly to the Mail app?

Currently this saves the file as a .jpg
How can I specify a .png file to be saved?

http://developer.xojo.com/iosimage$WriteToFile
specify a different type like public.png