C# 如何在 Windows 窗体应用程序中显示矢量图形 (SVG)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/397189/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 01:52:51  来源:igfitidea点击:

How do I display vector graphics (SVG) in a Windows Forms application?

c#.netwinforms

提问by Corin Blaikie

Is there a way (preferably a control) to display vector graphics (preferably SVG) in a Windows Forms application?

有没有办法(最好是控件)在 Windows 窗体应用程序中显示矢量图形(最好是 SVG)?

I'm guessing that this would be easy to do with WPF, but I would prefer not to have to migrate the project.

我猜这用WPF很容易做到,但我不想迁移项目。

回答by Arjan Einbu

GDI+and the Graphics class can do vector-graphics.

GDI+和 Graphics 类可以做矢量图形。

For SVG, you might try to load it into the WebBrowser control...

对于 SVG,您可以尝试将其加载到WebBrowser 控件中...

回答by scotru

You don't have to migrate your project to use WPF. Windows Forms projects can embed WPF controls. Check out SVGImage Control.

您不必迁移项目即可使用 WPF。Windows 窗体项目可以嵌入 WPF 控件。查看SVGImage 控件