Copy an image from a canvas to an imagewell

Hi, After loading an image, using the code g.DrawPicture(pic, 0, 0, lw, lh, 0, 0, pic.Width, pic.Height) I inserted it in the resized canvas, I would like to view the image in an imagewell without success, i tried with this code. I state that in the canvas the image can be seen and correctly resized
dim pic1 as New Picture(canvas1.Width,canvas1.Height, 32)
pic1= canvas1.Backdrop
ImageWell1.Width=lw
ImageWell1.Height=lh
ImageWell1.image=pic1
i also tried with
ImageWell.DrawInto(pic1.Graphics,0,0)
pic1 error = nil
I assume pic1 = canvas1.Backdrop is not good.
what is the right code to display it in the imagewell?
Thanks in advance to anyone who wants to help me
Mario

Anything you draw into a canvas is transient. You have to go back to the source material, in this case pic, if you want to recreate what is in the canvas.

You can probably…

dim pic1 as New Picture(canvas1.Width,canvas1.Height)
canvas1.DrawInto(pic1,0,0)
ImageWell1.image = pic1

Since DrawInto on the canvas should trigger the paint event on the canvas to let it paint correctly into the image.

Thanks Björn Eiríksson, I just had to fix canvas1.DrawInto(pic1,0,0) to canvas1.DrawInto(pic1.Graphics,0,0)
Thanks again