Is there a way to render SVG in Windows Forms?

后端 未结 5 703
被撕碎了的回忆
被撕碎了的回忆 2021-02-13 01:37

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 curre

相关标签:
5条回答
  • 2021-02-13 01:45

    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)"
    

    You can also try SVG Icon Builder. Please refer the following link to know more about that

    How To: Draw and Use SVG Images

    0 讨论(0)
  • 2021-02-13 01:47

    You could use Forms.WebBrowser with

    WebBrowser.Url = new Uri($"file://{pathSvg}");

    0 讨论(0)
  • 2021-02-13 01:48

    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.

    0 讨论(0)
  • 2021-02-13 01:49

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

    0 讨论(0)
  • 2021-02-13 01:56

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

    0 讨论(0)
提交回复
热议问题