Printing the contents of a window

Hello,
I understand the basic concept of printing text somewhere in the window but I have this problem:
I have a canvas in a Modal Dialog which has an image backdrop I’d like to print, plus some TextFields. I do not know how I can invoke DrawPicture to get this image (being a backdrop). Is there a way to print the full Dialog the way you see it on the screen?
Thank you

[code]Dim MyPict2Print As New Picture (cwidth,cheight)

MyPict2Print = Canvas1.Backdrop[/code]

But the best thing to use is an OffscreenPict: you print your data to it, then assign it to backdrop / and use it to print (or best, use the code to draw in the offscreenpicture to… print…)

Is it clear ?

[code] ’ hardprints the window content

dim g as Graphics
g = OpenPrinterDialog( mPrinterSetup, mParentWindow)
if g<>nil then
dim p as new Picture( mParentWindow.Width, mParentWindow.Height, 32)
mParentWindow.DrawInto p.Graphics, 0, 0
dim gheight as Integer = g.Width/p.Width*p.Height

g.DrawPicture p, 0, 0, g.Width, gheight, 0, 0, p.Width, p.Height

end if
[/code]

Thanks Jean-Yves, this is clear.
Emile, could you expand a little the OffscreenPict concept?
Thank you