Hi gnuwin32,
My goal is to convert picture in metafile format on clipboard to jpeg. For Excel Chart, window captures the data in metafile picture or enhanced metafile only. I save the HMETAFILE by
where metafile is the handle to picture METAFILEPICT structure. This creates C:\temp\new.wmf containing clipboard metafile data. When I pass new.wmf to wmf2gd.exe I get a memory error in libwmf.dll. I'm guessing the wmf file I created is not good. Does libwmf take metafile structures? Do you have any suggestion how to go about transform metafile data on clipboard? Thanks.
-Cathie
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi gnuwin32,
My goal is to convert picture in metafile format on clipboard to jpeg. For Excel Chart, window captures the data in metafile picture or enhanced metafile only. I save the HMETAFILE by
metafile = GetClipboardData(CF_METAFILEPICT);
new_metafile = CopyMetaFile(metafile->hMF, "C:\\temp\\new.wmf");
where metafile is the handle to picture METAFILEPICT structure. This creates C:\temp\new.wmf containing clipboard metafile data. When I pass new.wmf to wmf2gd.exe I get a memory error in libwmf.dll. I'm guessing the wmf file I created is not good. Does libwmf take metafile structures? Do you have any suggestion how to go about transform metafile data on clipboard? Thanks.
-Cathie
I think that your new.wmf is not a good wmf file. Can you view it in a file viewer (preferably, try several viewers)?
I can view wmf file in IE/Netsape. But the example .wmf files from download are not viewable via browers.
Could you perhaps upload a wmf-file that cannot be converted by wmf2gd?