在 .NET/C# 中绘制 SVG? [英] Drawing SVG in .NET/C#?

查看:28
本文介绍了在 .NET/C# 中绘制 SVG?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 C# 生成一个 SVG 文件.我已经有了以 PNG 和 EMF 格式绘制它们的代码(使用框架的标准类 System.Drawing.Imaging.MetafileZedGraph).您建议如何使该代码适应 SVG?最好我想找到一些可以模仿 System.Drawing.Graphics 界面.

I'd like to generate an SVG file using C#. I already have code to draw them in PNG and EMF formats (using framework's standard class System.Drawing.Imaging.Metafile and ZedGraph). What could you recommend to do to adapt that code to SVG? Preferably I'd like to find some library (free or not) that would mimic System.Drawing.Graphics interface.

推荐答案

查看 SVGC# 框架和一个 SVG-GDI+ 桥 项目.

从上面的网页...

SvgGdi 桥接器是一组类使用 SvgNet 在SVG 和 GDI+.这意味着任何使用 GDI+ 绘制的代码图形可以轻松地将 SVG 输出为好吧,只需插入SvgGraphics 对象.这个对象是与常规 .NET 完全相同图形对象,但创建一个 SVG树.甚至像孵化填充物这样的东西和线锚已实现.

The SvgGdi bridge is a set of classes that use SvgNet to translate between SVG and GDI+. What this means is that any code that uses GDI+ to draw graphics can easily output SVG as well, simply by plugging in the SvgGraphics object. This object is exactly the same as a regular .NET Graphics object, but creates an SVG tree. Even things like hatched fills and line anchors are implemented.

这篇关于在 .NET/C# 中绘制 SVG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆