Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

.net

winforms

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

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

like image 459
Corin Blaikie Avatar asked Dec 29 '08 05:12

Corin Blaikie


People also ask

Can an SVG file be vector?

Scalable Vector Graphics (SVG) is a web-friendly vector file format. As opposed to pixel-based raster files like JPEGs, vector files store images via mathematical formulas based on points and lines on a grid.

Does Word support SVG?

Microsoft Word, PowerPoint, Outlook, and Excel for Microsoft 365 on Windows, Mac, Android, and Windows Mobile support inserting and editing scalable vector graphics (. SVG) files in your documents, presentations, email messages, and workbooks.


2 Answers

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

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

like image 156
Arjan Einbu Avatar answered Sep 21 '22 23:09

Arjan Einbu


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

like image 39
scotru Avatar answered Sep 22 '22 23:09

scotru