具有强制抗锯齿功能的 EMF
我们的程序需要生成矢量图形,为此我们选择了 EMF。然而,其他程序似乎使这些图像呈现非抗锯齿效果。我发现 SVG 格式确实有一个标志来指示某些/所有对象应该抗锯齿。
EMF 格式中是否有任何类型的标志或命令来表明我们想要抗锯齿?如果是这样,如何使用 System.Drawing 生成该命令.Imaging.Metafile 类?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
EMF 文件是 GDI 命令的列表。因此,即使在 GDI+ 下,您在绘图之前调用 SmoothingMode(),它也不会消除锯齿。您必须枚举 GDI 命令,然后将其转换为 GDI+ 命令。
在 Vista/7 下,您可以使用名为 GdipConvertToEmfPlus/ConvertToEmfPlus 的 GDI+ 1.1 函数。
如果您希望您的程序在 XP 下运行,您应该编写自己的枚举,然后转换为 GDI+ 命令。我们已经在 Delphi 中完成了此操作,也许源代码可以帮助您。
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.