2

Do EMF files have a DPI that can be set? I have an application that allows saving an image in multiple formats (including EMF). I allow the user to specify the resolution/DPI for the image(s). However, I cannot find a way to do this for a MetaFile in C#. Is this possible or does EMF not have a DPI since it is a vector graphics format?

KrisTrip
  • 4,943
  • 12
  • 55
  • 74

2 Answers2

1

According to the MS-EMF spec, no. But ‘EMF plus’ extensions (MS-EMFPLUS) have a header with LogicalDpiX and LogicalDpiY. This format is analogous to GDI+. I don't know what software supports it for import/export though.

bobince
  • 528,062
  • 107
  • 651
  • 834
  • This doesn't help do this in C#, but you can effectively change the resolution of emf's using PowerPoint: http://stackoverflow.com/questions/15388048/change-resolution-of-emf-image-files-to-prevent-quality-loss-in-powerpoint – Jamie G Mar 13 '13 at 14:27
1

Metafiles do not have a DPI because they do not have dots - it is a vector graphics format. Metafiles do have size, which is presumably what you want. You can set the size of a metafile (in HIMETRIC) when you call the Metafile constructor.

Oliver Bock
  • 4,829
  • 5
  • 38
  • 62