⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual.html

📁 SVG 是一种广泛使用的矢量图格式
💻 HTML
字号:
<head><!-- Generated by perlmod2www.pl --><title>Manual documentation.</title></head><body bgcolor="white"><HR><H4>SVG</H4><H3>Manual</H3><A NAME="TOP"></A><TABLE BORDER="1" WIDTH="100%"><TR><TD><A HREF="#SUMMARY">Summary</A></TD><TD><A HREF="#vardefs">Package variables</A></TD><TD><A HREF="#SYNOPSIS">Synopsis</A></TD><TD><A HREF="#DESCRIPTION">Description</A></TD><TD><A HREF="#General">General documentation</A></TD></TR></TABLE><HR><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0"><TR><TD BGCOLOR="#ffae84"><B>Summary</B></TD></TR></TABLE><TABLE BORDER="0" WIDTH="100%"><TR><TD><pre>SVG - Perl extension for generating Scalable Vector Graphics (SVG) documents<BR></pre></TD></TR></TABLE><A NAME="vardefs"></A><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0"><TR BGCOLOR="#ffae84"><TD><B>Package variables</B></TD><TD ALIGN="RIGHT"><A HREF="#TOP">top</A></TD></TR></TABLE><TABLE BORDER="0" WIDTH="100%"><TR><TD COLSPAN="2">No package variables defined.</TD></TR></TABLE><A NAME="SYNOPSIS"></A><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0"><TR BGCOLOR="#ffae84"><TD><B>Synopsis</B></TD><TD ALIGN="RIGHT"><A HREF="#TOP">top</A></TD></TR></TABLE><TABLE BORDER="0"><TR><TD COLSPAN="2"><pre>    #!/usr/bin/perl -w<BR>    use strict;<BR>    use SVG;<BR><BR>    # create an SVG object<BR>    my $svg= SVG-&gt;new(width=&gt;200,height=&gt;200);<BR><BR>    # use explicit element constructor to generate a group element<BR>    my $y=$svg-&gt;group(<BR>        id    =&gt; 'group_y',<BR>        style =&gt; { stroke=&gt;'red', fill=&gt;'green' }<BR>    );<BR><BR>    # add a circle to the group<BR>    $y-&gt;circle(cx=&gt;100, cy=&gt;100, r=&gt;50, id=&gt;'circle_in_group_y');<BR><BR>    # or, use the generic 'tag' method to generate a group element by name<BR>    my $z=$svg-&gt;tag('g',<BR>                    id    =&gt; 'group_z',<BR>                    style =&gt; {<BR>                        stroke =&gt; 'rgb(100,200,50)',<BR>                        fill   =&gt; 'rgb(10,100,150)'<BR>                    }<BR>                );<BR><BR>    # create and add a circle using the generic 'tag' method<BR>    $z-&gt;tag('circle', cx=&gt;50, cy=&gt;50, r=&gt;100, id=&gt;'circle_in_group_z');<BR><BR>    # create an anchor on a rectangle within a group within the group z<BR>    my $k = $z-&gt;anchor(<BR>        id      =&gt; 'anchor_k',<BR>        -href   =&gt; '<a href="http://test.hackmare.com" target="urlWin">http://test.hackmare.com</a>/',<BR>        -target =&gt; 'new_window_0'<BR>    )-&gt;rectangle(<BR>        x     =&gt; 20, y      =&gt; 50,<BR>        width =&gt; 20, height =&gt; 30,<BR>        rx    =&gt; 10, ry     =&gt; 5,<BR>        id    =&gt; 'rect_k_in_anchor_k_in_group_z'<BR>    );<BR><BR>    # now render the SVG object, implicitly use svg namespace<BR>    print $svg-&gt;xmlify;<BR><BR>    # or render a child node of the SVG object without rendering the entire object<BR>    print $k-&gt;xmlify; #renders the anchor $k above containing a rectangle, but does not<BR>                      #render any of the ancestor nodes of $k<BR><BR>    # or, explicitly use svg namespace and generate a document with its own DTD<BR>    print $svg-&gt;xmlify(-namespace=&gt;'svg');<BR><BR>    # or, explicitly use svg namespace and generate an in-line docunent<BR>    print $svg-&gt;xmlify(<BR>        -namespace =&gt; &quot;svg&quot;,<BR>        -pubid =&gt; &quot;-//W3C//DTD SVG 1.0//EN&quot;,<BR>        -inline   =&gt; 1<BR>    );<BR></pre></TD></TR></TABLE><A NAME="DESCRIPTION"></A><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0"><TR BGCOLOR="#ffae84"><TD><B>Description</B></TD><TD ALIGN="RIGHT"><A HREF="#TOP">top</A></TD></TR></TABLE><TABLE BORDER="0"><TR><TD COLSPAN="2"><pre>SVG is a 100% Perl module which generates a nested data structure containing the<BR>DOM representation of an SVG (Scalable Vector Graphics) image. Using SVG, you<BR>can generate SVG objects, embed other SVG instances into it, access the DOM<BR>object, create and access javascript, and generate SMIL animation content.<BR></pre><pre>Generating SVG is a simple three step process:<BR><BR><BR><A NAME="_pod_1 The first step is to construct a new SVG object with L<"new">.">    1 The first step is to construct a new SVG object with L<"new">.</A><BR><A NAME="_pod_">    </A><BR><A NAME="_pod_">    </A><BR><BR>The <a href="#_pod_"xmlify"">"xmlify"</a> method takes a number of optional arguments that control how SVG<BR>renders the object into XML, and in particular determine whether a stand-alone<BR>SVG document or an inline SVG document fragment is generated:<BR><BR><BR><A NAME="_pod_-stand-alone">    -stand-alone</A><BR>    A complete SVG document with its own associated DTD. A namespace for the SVG<BR>elements may be optionally specified.<BR><BR><A NAME="_pod_-in-line">    -in-line</A><BR>    An in-line SVG document fragment with no DTD that be embedded within other XML<BR>content. As with stand-alone documents, an alternate namespace may be specified.<BR><BR><BR>No XML content is generated until the third step is reached. Up until this<BR>point, all constructed element definitions reside in a DOM-like data structure<BR>from which they can be accessed and modified.<BR></pre><pre>None. However, SVG permits both options and additional element methods to be<BR>specified in the import list. These options and elements are then available<BR>for all SVG instances that are created with the <a href="#_pod_"new"">"new"</a> constructor. For example,<BR>to change the indent string to two spaces per level:<BR><BR>    use SVG qw(-indent =&gt; &quot;  &quot;);<BR><BR>With the exception of -auto, all options may also be specified to the <a href="#_pod_"new"">"new"</a><BR>constructor. The currently supported options are:<BR><BR>    -auto        enable autoloading of all unrecognised method calls (0)<BR>    -indent      the indent to use when rendering the SVG into XML (&quot;\t&quot;)<BR>    -inline      whether the SVG is to be standalone or inlined (0)<BR>    -printerror  print SVG generation errors to standard error (1)<BR>    -raiseerror  die if a generation error is encountered (1)<BR>    -nostub      only return the handle to a blank SVG document without any elements<BR><BR>SVG also allows additional element generation methods to be specified in the<BR>import list. For example to generate 'star' and 'planet' element methods:<BR><BR>    use SVG qw(star planet);<BR><BR>or:<BR><BR>    use SVG (&quot;star&quot;,&quot;planet&quot;);<BR><BR>This will add 'star' to the list of elements supported by SVG.pm (but not of<BR>course other SVG parsers...). Alternatively the '-auto' option will allow<BR>any unknown method call to generate an element of the same name:<BR><BR>    use SVG (-auto =&gt; 1, &quot;star&quot;, &quot;planet&quot;);<BR><BR>Any elements specified explicitly (as 'star' and 'planet' are here) are<BR>predeclared; other elements are defined as and when they are seen by Perl. Note<BR>that enabling '-auto' effectively disables compile-time syntax checking for<BR>valid method names.<BR><BR><b>Example:</b><BR><BR>    use SVG (<BR>        -auto       =&gt; 0,<BR>        -indent     =&gt; &quot;  &quot;,<BR>        -raiserror  =&gt; 0,<BR>        -printerror =&gt; 1,<BR>        &quot;star&quot;, &quot;planet&quot;, &quot;moon&quot;<BR>    );<BR></pre></TD></TR></TABLE><A NAME="MethDesc"></A><HR><H2>Methods description</H2><FONT COLOR="RED"><B>None available.</B></FONT><BR><A NAME="MethCode"></A><HR><H2>Methods code</H2><FONT COLOR="RED"><B>No methods available.</B></FONT><BR><A NAME="General"></A><HR><H2>General documentation</H2><TABLE BORDER="0" WIDTH="100%" CELLSPACING="0"><TR BGCOLOR="#4492df"><TD><A NAME="_pod_VERSION"><B>VERSION</A></B></TD><TD><A HREF="#TOP">top</A></TD></TR><TR><TD COLSPAN="2"><pre>Version 2.24 (29.01.03)<BR>Covers SVG-2.27 distribution<BR></pre></TD></TR><TR BGCOLOR="#4492df"><TD><A NAME="_pod_SEE ALSO(1)"><B>SEE ALSO(1)</A></B></TD><TD><A HREF="#TOP">top</A></TD></TR><TR><TD COLSPAN="2"><pre>    perl(1), <a href="http://roasp.com" target="urlWin">http://roasp.com</a>VG::Element&gt;, <a href="http://roasp.com" target="urlWin">http://roasp.com</a>VG::Parser&gt;<BR>    <a href="http://roasp.com" target="urlWin">http://roasp.com</a>/<BR>    <a href="http://www.w3c.org/Graphics/SVG" target="urlWin">http://www.w3c.org/Graphics/SVG</a>/<BR></pre></TD></TR><TR BGCOLOR="#4492df"><TD><A NAME="_pod_AUTHOR"><B>AUTHOR</A></B></TD><TD><A HREF="#TOP">top</A></TD></TR><TR><TD COLSPAN="2"><pre>Ronan Oger, RO IT Systemms GmbH, <a href="mailto:ronan@roasp.com">ronan@roasp.com</a><BR></pre></TD></TR><TR BGCOLOR="#4492df"><TD><A NAME="_pod_CREDITS"><B>CREDITS</A></B></TD><TD><A HREF="#TOP">top</A></TD></TR><TR><TD COLSPAN="2"><pre>Peter Wainwright, <a href="mailto:peter@roasp.com">peter@roasp.com</a> Excellent ideas, beta-testing, SVG::Parser<BR>Fredo, <a href="http://www.penguin.at0.net/~fredo" target="urlWin">http://www.penguin.at0.net/~fredo</a>/ - provided initial feedback<BR>for early SVG.pm versions<BR>Adam Schneider, improvements to xmlescp providing improved character support<BR>Brial Pilpr

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -