Bitmap from Clipboard back to Clipboard as PNG?

M

Michael Phillips, Jr.

Dim lMemoryStream As New MemoryStream
lImage.Save(lMemoryStream,
System.Drawing.Imaging.ImageFormat.Tiff)
Dim lDataObject As New DataObject
'rewind the stream to position 0
lDataObject.SetData("TIFF", False, lMemoryStream)
Clipboard.SetDataObject(lDataObject)

The above code works, if you make the change that I indicated.

In all cases(i.e., "PNG", "TIFF"), you must rewind the stream to position 0
before placing the stream in the DataObject.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top