emf
files are just a list of GDI commands. In fact, they can be "played back" very easily by the system, using standard Windows GDI command (in Delphi, a TMetaFile
is just a wrapper around those APIs).
When IrfanView or FastReport renders the metafile content, they just use Windows GDI corresponding commands. When Windows 7 Paint renders the metafile content, it uses the GDI+ renderer. I even think it internally convert the emf
file into emf+
format, then renders it with anti-aliaising using GDI+.
So if the emf
file renders incorrectly in IrfanView or FastReport, I suspect this is because your metafile is not well formed: the third party graphic engine you are using is producing non standard emf. A possible issue is that the font used is missing in the target system, and GDI does not substitute the font with the same as GDI+ does.
Another possibility is that the emf
file is maybe a dual format: it contains both emf
format (which was not properly created so is not rendered correctly using GDI) and emf+
format (which is rendered as expected using GDI+). Normally this dual emf/emf+
format should not exist: even the official GDI+ library does not allow to save its metafile content in emf+. This is some kind of "monster" format, created by your third-party library.
I suggest the following:
- Download and check your
emf
file with EmfExplorer;
- Try to use GDI+ to render the metafile;
- Try to use the
emf
to emf+
converter API.
For using GDI+, take a look at an Open Source SynGdiPlus unit: it will add GDI+ anti-aliaising to your produced bitmap. It is able to convert emf
to emf+
. It will use native Vista/Seven API (just like Windows 7 paint), or plain Delphi code under Windows XP.