Is there a way to render SVG in Windows Forms?

2020-02-05 12:34发布

I am working with a library that renders part of its state as an SVG document.

I would like to render this in either a Windows Forms or a WPF environment. Is there currently a way to do this?

If not, I could modify the library to use a more general rendering strategy, and then add an XML adapter to restore the original functionality, but this is not my preferred strategy.

3条回答
▲ chillily
2楼-- · 2020-02-05 13:11

I have tried SVG.NET with WinForms and it works excellent.

查看更多
够拽才男人
3楼-- · 2020-02-05 13:13

Have you looked at Ab2d set of Apis? ReaderSvg and ViewerSvg seems to do the job? But they aren´t free!

查看更多
Ridiculous、
4楼-- · 2020-02-05 13:24

If you are using the webbrowser control for SVG, you will have a problem with Access Violation due to Data Execution Prevention.

The workaround is to have the following lines in your post-build events

call "$(DevEnvDir)..\..\VC\bin\vcvars32.bat"
call "$(DevEnvDir)..\..\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)"

For additional information see this link.

查看更多
登录 后发表回答