I have an application that can load various graphical file formats such as bmp, jpg, png, emf, etc... and render them onto the screen for previewing.
I am using Delphi 7. I have just been introduced to the EMF+ file format that was created around the time of Windows XP that is created utilizing the GDIPlus.dll. I can open the EMF+ files with Windows Picture Viewer and the image is very high quaility and can zoom in and out without any blurring at all.
The problem is I can't seem to find a way (in Delphi 7) to open this file format and render it on the screen. Does anyone know of a code sample or component that can be used in Delphi 7 to render an EMF+ file?
You can use a "TMetaFileCanvas" that has EMF support. A code snippet:
This way you can load EMF, draw to EMF and save it. But presenting it as a vector graphics from Delphi is another problem altogether. Delphi only works well with bitmap graphics out of the box. But as I understand you only want to read and draw it. To convert it to BMP for instance you can do:
EDIT:
As Marco kindly pointed out TMetaFileCanvas probably woun't work correctly with EMF+. Haven't tested that so I can't confirm it.
But there seems to be a unit that works with that.
http://blog.synopse.info/post/2010/04/02/Antialiased-drawing-from-TMetaFile
Download is available from:
http://synopse.info/files/SynGdiPlus.zip
Havent checked it out myself, but it looks appropriate for the job.