G
George Yefchak
Hi
I need to retrieve a metafile image from the clipboard and render it as a
bitmap in my application. In particular, an image will be placed on the
clipboard by pasting from PowerPoint (I really do need to do this!). The
original image is a bitmap, but PowerPoint doesn't place it on the clipboard
as such. A call to GetFormats() indicates that MetafilePict and
EnhancedMetaFile are available formats.
The following does NOT work:
Dim metaFile As System.Drawing.Imaging.Metafile
If data.GetDataPresent(DataFormats.MetafilePict) Then
obj = data.GetData(DataFormats.MetafilePict, True)
metaFile = CType(obj, System.Drawing.Imaging.Metafile)
....
End If
The GetDataPresent() test returns true, indicating there is a MetafilePict.
The GetData returns something (it's not "Nothing") but I can't figure out
what to do with it. The CType returns "Nothing" in metaFile.
Help?
Thanks,
--George
* George Yefchak
* Phone: 408-970-0419
* Cell: 408-981-5521
* E-mail: (e-mail address removed)
* Web: www.yefchak.com
I need to retrieve a metafile image from the clipboard and render it as a
bitmap in my application. In particular, an image will be placed on the
clipboard by pasting from PowerPoint (I really do need to do this!). The
original image is a bitmap, but PowerPoint doesn't place it on the clipboard
as such. A call to GetFormats() indicates that MetafilePict and
EnhancedMetaFile are available formats.
The following does NOT work:
Dim metaFile As System.Drawing.Imaging.Metafile
If data.GetDataPresent(DataFormats.MetafilePict) Then
obj = data.GetData(DataFormats.MetafilePict, True)
metaFile = CType(obj, System.Drawing.Imaging.Metafile)
....
End If
The GetDataPresent() test returns true, indicating there is a MetafilePict.
The GetData returns something (it's not "Nothing") but I can't figure out
what to do with it. The CType returns "Nothing" in metaFile.
Help?
Thanks,
--George
* George Yefchak
* Phone: 408-970-0419
* Cell: 408-981-5521
* E-mail: (e-mail address removed)
* Web: www.yefchak.com