Get DIB from Clipboard?

  • Thread starter Thread starter Just Me
  • Start date Start date
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
 
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
 
Ken,

What's the difference between

Dim data As IDataObject

and

Dim data As DataObject

both seem to work!
 
Back
Top