paint in canvas ,how to save

how to save paint int canvas .

Create a picture
Draw into the picture
Then draw the picture into the canvas
And you can save the picture

#1 Put your paint code in an additional method so it can be called in canvas.paint or when you create or save a picture.

#2 For OS X, you can use APIs to extract the Canvas data as a bitmap or PDF and then save that data,

Personally I would advise against Norman’s suggestion (sorry Norman) as this method is not Retina safe.

[code] #If Targetwin32 then
App.UseGDIPlus = True
#endif

dim p as new picture(Canvas1.width, Canvas1.Height)
Canvas1.DrawInto(p.graphics,0,0)

Dim f As FolderItem
f = GetSaveFolderItem(“image/jpeg”, “myPicture.jpeg”)
if f <> nil then
p.Save(f, Picture.SaveAsJPEG)
end if
[/code]

For other formats than jpeg, see http://documentation.xojo.com/index.php/Picture.Save

[quote=256485:@Sam Rowlands]
Personally I would advise against Norman’s suggestion (sorry Norman) as this method is not Retina safe.[/quote]
It CAN be
Thats what we just did with the IDE :stuck_out_tongue: