Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EMF with forced antialiasing

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.

like image 772
liori Avatar asked Dec 23 '22 09:12

liori


1 Answers

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.

like image 145
Arnaud Bouchez Avatar answered Jan 08 '23 07:01

Arnaud Bouchez