ReaderWmf and Clipboard
#2
Hi,

Currently this is quite complicated. I am already preparing a new version where it will be very easy to read metafile from Clipboard and convert it into WPF objects.

With the current version you can use GetFromHemf or GetGeometryFromHemf methods on ReaderWmf to read metafile from clipboard.

For example:
Viewbox pastedObjects = Ab2d.ReaderWmf.Instance.GetFromHemf(hemf).

The tricky part is to get hemf - the handle to a clipboard object (as IntPtr). You can get the handle with COM interop. - Use GetClipboardData function (defined in user32.dll). Before calling GetClipboardData, you should check if metafile is stored on the clipboard with calling IsClipboardFormatAvailable with CF_ENHMETAFILE parameter and if metafile exist open the clipboard before calling GetClipboardData (don't forget to close the clipboard afterward).

Check the web for samples on using the functions.

Or you can wait a little for the new version of ReaderWmf - it will be available in a week or two.
  


Messages In This Thread
ReaderWmf and Clipboard - by abody - 06-28-2010, 01:52 PM
RE: ReaderWmf and Clipboard - by abenedik - 06-29-2010, 02:53 PM
RE: ReaderWmf and Clipboard - by abody - 06-29-2010, 03:08 PM
RE: ReaderWmf and Clipboard - by abenedik - 06-29-2010, 03:21 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)