问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/1422949/emf-with-forced-antialiasing