Re: Error Saving EMF Metafile from Clipboard

Tech-Archive recommends: Fix windows errors by optimizing your registry



Here is an example in code:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2082527&SiteID=1

In your case, after you create a memory mapped file handle for your image
size(i.e., height * stride), you use the handle with CreateDIBSection to
create an empty bitmap to draw your metafile on.

After you convert the metafile to the DIB, you use the same memory mapped
handle to create the WIC BitmapSource.
Using the WIC BitmapSource you encode the image as a TIFF.

The following is an outline of the steps:
1) Create the empty DIB as outlined above.
2) Create a memory DC backed by the video driver.
3) Select the empty DIB into the memory DC
4) PlayEnhMetafile into the DC.
5) Select the DIB out fo the DC.
6) Create the BitmapSource using the handle to the memory mapped file.
7) Encode the BitmapSource to a TIFF.


.