I'm working on a system that have huge database of metafiles (the old win3.0 format), and I need to convert that to Enhanced Metafile. I did convert the whole database, and manage to play the files to the display as it should be, except one thing:
The old metafiles use the current pen/brush to play the file to the screen.
On the other hand the enhanced metafiles need the pen to be "save"
inside the file, and I didn't manage to change it in runtime.
I need a way to change the enhanced metafile pen, in runtime, so one metafile can be played in different pens depending on the application running.
I found a way.
Thanks to Grey Wolf http://www.cplusplus.com/user/z05DSL3A/
Follow the solution (written by GreyWolf): I have a class (somewhere) than handles EMFs as grey scales, as I remember you have to supply a callback function can on the fly replace the colour values with appropriate grey levels. I'll see if I can find the code (but it will not be until the weekend...as long as I remember).
Another thing you could try is using a generic postscript drive (from Adobe).
-== Edit ==-
To use the code below create a CGrayEMF object and call its EnumEMF() method. I don't think that it converts embedded bitmaps, but that should be able to be added.