如何在asp.net中使用svg标签创建的文件夹中存储图像 [英] how to store an image in folder created with svg tag in asp.net

查看:112
本文介绍了如何在asp.net中使用svg标签创建的文件夹中存储图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码,我创建了带有svg标签的图像:

Here is my Code i have crated image with svg tag:

<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" id="svg1" runat="server">
                            <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
 <g id="g1" runat="server">

  <rect stroke="#020202" fill="#000000" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="43.00001" y="18" width="539.99996" height="292.99999" id="svg_73" onclick="javascript:hello(this);"/>
  <%--<ellipse fill="#7fff00" stroke="#fffcfc" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" cx="135" cy="247" id="svg_14" onclick="javascript:hello(this);"/>--%>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="310" y="49" width="16" height="46" id="svg_39" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#ffffff" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="269" y="110" width="21" height="0" id="svg_40" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="329" y="50.5" width="16" height="46" id="svg_48" transform="rotate(2.63243 337 73.5)" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="349" y="52.5" width="16" height="46" id="svg_49" transform="rotate(3.77228 357 75.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff7f00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="368" y="54.5" width="16" height="46" id="svg_50" transform="rotate(5.37671 376 77.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff7f00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="388" y="57.5" width="16" height="46" id="svg_51" transform="rotate(8.42697 396 80.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff7f00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="409" y="62.5" width="16" height="46" id="svg_52" transform="rotate(10.9111 417 85.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff0000" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="426" y="68.5" width="16" height="46" id="svg_53" transform="rotate(12.3954 434 91.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff0000" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="444" y="75.5" width="16" height="46" id="svg_54" transform="rotate(15.7924 452 98.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff0000" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="460" y="83.5" width="16" height="46" id="svg_55" transform="rotate(16.7557 468 106.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff0000" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="477" y="94.5" width="16" height="46" id="svg_56" transform="rotate(25.3197 485 117.5)" onclick="javascript:hello(this);"/>
  <rect fill="#ff0000" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="494" y="107.5" width="16" height="46" id="svg_57" transform="rotate(29.3272 502 130.5)" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="287" y="49.5" width="16" height="46" id="svg_58" transform="rotate(-2.51688 295 72.5)" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="264" y="52.5" width="16" height="46" transform="rotate(-5.02408 272 75.5)" id="svg_59" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="240" y="56.5" width="16" height="46" transform="rotate(-7.19923 248 79.5)" id="svg_60" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="217" y="61.5" width="16" height="46" transform="rotate(-9.18054 225 84.5)" id="svg_61" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="195" y="67.5" width="16" height="46" transform="rotate(-14.7746 203 90.5)" id="svg_62" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="172" y="73.5" width="16" height="46" transform="rotate(-18.2576 180 96.5)" id="svg_63" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="153" y="82.5" width="16" height="46" transform="rotate(-21.1613 161 105.5)" id="svg_64" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="136" y="93.5" width="16" height="46" transform="rotate(-24.7751 144 116.5)" id="svg_65" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="119" y="104.5" width="16" height="46" id="svg_66" transform="rotate(-32.4276 127 127.5)" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="102" y="119.5" width="16" height="46" transform="rotate(-41.0424 110 142.5)" id="svg_67" onclick="javascript:hello(this);"/>
  <rect fill="#7fff00" stroke="#020202" stroke-width="5" stroke-dasharray="null" stroke-linejoin="null" stroke-linecap="null" x="310.00001" y="107.5" width="16" height="46" id="svg_68" onclick="javascript:hello(this);"/>
  <text fill="#ffffff" stroke-width="0" x="228.69761" y="80.72727" id="svg_2" font-size="8" font-family="serif" text-anchor="middle" xml:space="preserve" transform="matrix(3.58333 0 0 2.75 -744 -106.75)" stroke="#ffffff" font-weight="bold" onclick="javascript:hello(this);" runat="server">0%</text>
  <text id="svg_1" fill="#ffffff" stroke-width="0" x="298.02348" y="52.36364" font-size="8" font-family="serif" text-anchor="middle" xml:space="preserve" transform="matrix(3.58333 0 0 2.75 -744 -106.75)" stroke="#ffffff" font-weight="bold" onclick="javascript:hello(this);" runat="server">50%</text>
  <text font-weight="bold" stroke="#ffffff" transform="matrix(3.58333 0 0 2.75 -744 -106.75)" xml:space="preserve" text-anchor="middle" font-family="serif" font-size="8" y="75.27273" x="358.86075" stroke-width="0" fill="#ffffff" id="svg_3" onclick="javascript:hello(this);" runat="server">100%</text>
  <text fill="#ffffff" stroke-width="0" x="295.79092" y="115.63636" font-size="15" font-family="serif" text-anchor="middle" xml:space="preserve" transform="matrix(3.58333 0 0 2.75 -744 -106.75)" stroke="#ffffff" font-weight="bold" id="svg_4" onclick="javascript:hello(this);" runat="server">Label1</text>
 </g>

</svg>



how to convert sav tag to image in asp.net
How to save as above image in my folder in asp.net..please help me..



how to convert sav tag to image in asp.net
How to save as above image in my folder in asp.net..please help me..

推荐答案

First of all, think about using SVG directly on your Web pages. As this is a vector image, you can get way better quality; you can scale or auto-scale the image to some element without any loss of quality and do a lot more. You can also convert SVG to XAML. SVG is a very good and powerful thing and practically the only universally recognized non-proprietary platform-independent vector image standard.

To use SVG on a page, you can have the following options: <embed>, <object>, <iframe> tags and direct embedding it in HTML5 code. Please see for detailed instruction and some pro/conta information for each of the approaches:
http://www.w3schools.com/svg/svg_inhtml.asp[^].

Rendering some SVG on a bitmap is pretty easy, but you might need some SVG processing engine for .NET.

For example, please see this CodeProject article:
An SVG framework in C# and an SVG-GDI+ bridge[^].

另请参见:
Simple SVG Editor[^].

—SA
First of all, think about using SVG directly on your Web pages. As this is a vector image, you can get way better quality; you can scale or auto-scale the image to some element without any loss of quality and do a lot more. You can also convert SVG to XAML. SVG is a very good and powerful thing and practically the only universally recognized non-proprietary platform-independent vector image standard.

To use SVG on a page, you can have the following options: <embed>, <object>, <iframe> tags and direct embedding it in HTML5 code. Please see for detailed instruction and some pro/conta information for each of the approaches:
http://www.w3schools.com/svg/svg_inhtml.asp[^].

Rendering some SVG on a bitmap is pretty easy, but you might need some SVG processing engine for .NET.

For example, please see this CodeProject article:
An SVG framework in C# and an SVG-GDI+ bridge[^].

See also:
Simple SVG Editor[^].

—SA


这篇关于如何在asp.net中使用svg标签创建的文件夹中存储图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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