Capture to clipboard

bornbroke

Member
Joined
May 11, 2005
Messages
6
Hi,

The program draws an image directly to the Form and not to a picturebox.

Code:
hDC = User.GetDC(Me.Handle)
EnableOpenGL(hDC)
draw code follows ...

How can I copy this image drawn to the form to the clipboard?

[VB]
Clipboard.SetDataObject(Picturebox1.image) If this was drawn to a picbox
How do I convert the above command??
???
[/code]

Is this possible? Or do I have to use a picturebox??? Although I know that a picturebox would simplify my problem, there is another issue with regards of using a picturebox, therefore, if possible I would like to avoid using it.

However, if it is impossible!! please mention it so I wont spend any more time trying. thanks.
 
Instead of painting directly on the form, I would do the drawing to some Bitmap variable of the same dimensions of the forms region. After all the drawing on the Bitmap is completed, then paint the Bitmap itself on the form. In addition to reducing flicker, this will also enable you to easily use Clipboard.SetDataObject().
 
Back
Top