Is there a way to render SVG in Windows Forms?

自闭症网瘾萝莉.ら 提交于 2019-12-17 19:34:14

问题


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.


回答1:


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




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/1484975/is-there-a-way-to-render-svg-in-windows-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!