Get DIB from Clipboard?

J

Just Me

1) Is there a relative easy way to get a DIB from the clipboard?

2) what is returned with GetData if the clipboard contains a DIB (the DIB,
HtoDIB,...)?


Thanks in advance
 
K

Ken Tucker [MVP]

Hi,

Usually the data is present in several formats on the clipboard.
This should work in most cases.


Dim data As IDataObject

Dim bmap As Image

data = Clipboard.GetDataObject()

If data.GetDataPresent(GetType(System.Drawing.Bitmap)) Then

bmap = CType(data.GetData(GetType(System.Drawing.Bitmap)), Image)

End If


Ken

----------------
1) Is there a relative easy way to get a DIB from the clipboard?

2) what is returned with GetData if the clipboard contains a DIB (the DIB,
HtoDIB,...)?


Thanks in advance
 
J

Just Me

Ken,

What's the difference between

Dim data As IDataObject

and

Dim data As DataObject

both seem to work!
 

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