EMF with forced antialiasing
Asked Answered
E

1

4

Our program needs to generate vector graphics, and we chose EMF for that. However, it seems that other programs render these images non-antialiased. I found that SVG format does have a flag to indicate that some/all objects should be antialiased.

Is there any kind of flag or command inside the EMF format to indicate that we want to have antialiasing? If so, how to generate that command using System.Drawing.Imaging.Metafile class?

Thank you.

Ernst answered 14/9, 2009 at 17:41 Comment(0)
A
11

EMF file is a list of GDI commands. So it won't be anti-aliaised, even if under GDI+, you put a SmoothingMode() call before the drawing. You'll have to enumerate the GDI commands, then translate it into GDI+ commands.

Under Vista/Seven, you can use GDI+ 1.1 function named GdipConvertToEmfPlus/ConvertToEmfPlus. If you want your program to work with XP, you should write your own enumeration, then conversion to GDI+ commands. We've done this in Delphi, perhaps the source code may help you.

Abeyant answered 6/12, 2010 at 7:27 Comment(1)
@MisterDownVoter please give some explanation of your -1 ! EMF files won't never be antialiaised even with SmoothingMode set to AntiAlias. You need to convert it to EMF+ format before. The Josh answer above is not correct, mine is. I only wrote it here because the previous answer was not working, and I spent a lot of time finding out a solution.Abeyant

© 2022 - 2024 — McMap. All rights reserved.