Comment 5 for bug 1419686

Revision history for this message
David Mathog (mathog) wrote :

I could not open that cdr properly (no coreldraw, and Inkscape does a bad job of it - the star image is surrounded by a white, not transparent, region.) That EMF consists of a huge number of polybezier circular rings (to produce the circular gradient) which is then completely overwritten by an image of a blue star on a background with the same circular gradient. So CorelDraw does not preserve whatever transparency there was in the original drawing, it makes a bitmap of the screen image. The sawtooth effect is from a combination of the bitmapping and a lack of antialiasing.

The EMF it produces is also messed up, but in the expected way, since the gradient is entirely covered by the image, there is no reason whatsoever to have it in the EMF. I can tell you why that happened too. CorelDraw sent the objects to its output driver in the order bottom to top. So first it sent the gradient. EMF does not have a native way of representing a circular gradient, and the driver choose to emulate it with a series of rings (via MOVETOEX and POLYBEZIERTO16 records), which it sent to the EMF. Then it sent an image with transparent areas. The driver cannot send a transparency to EMF, so it bitmaps the part of the drawing within the bounds of the image and then sends that bitmap to the EMF. That is the STRETCHDIBITS record near the end of the EMF.

You can dump the contents of EMF files to a text file using the reademf application in libUEMF (from sourceforge). If you are on windows get the programs EMF Explorer and metafile explorer (this is the better of the two). You can find the downloads for these with Google. From reademf we can see that the emf file produced has only EMF records and no EMF+ records. (Which doesn't matter yet for Inkscape because I have yet to implement an EMF+ driver, although the bones for it are in libUEMF. I have not done that yet because I found that PowerPoint omits all text when it emits EMF+ records, making that format useless for most things for the most common application where it would be used!)