Save .png from canvas with checkbox in listbox

Hi everyone,

I’m trying to export the content of a canvas into a .png file; canvas has several listboxes. Everything is doing well except listbox with checkbox cells because all the checkboxes are missing in the .png file. The canvas’ name is cvCentral. My code is:

[code]Dim pict As Picture
Dim Stamp As String
Dim f As FolderItem

Stamp = “Fecha”
f = GetSaveFolderItem(“image/png”,"" + Stamp + “.png”)
If f <> Nil Then
pict = New Picture(cvordi.Left + cvOrdi.Width + 20, cvIz.Height, 32)
cvCentral.DrawInto pict.Graphics, 0, 0
pict.Save(f, Picture.SaveAsPNG)
End If[/code]

Thanks for your help !

I see. Any help.
Thank you guys.

Rather than using the built-in checkboxes, draw them in the CellBackgroundPaint event and keeping track of the value in CellTag. The DrawInto issue has been around as long as I can remember.

You can probably get a complete picture by doing window.drawInto. Then crop to the canvas size.

Michel, I can’t do that because canvas is bigger than the window. Anthony, thanks. I realised other things don’t draw properly either…