如何绘制SVG箭头,以便ImageMagick将其导出为PNG
这是我的SVG文件:如何绘制SVG箭头,以便ImageMagick将其导出为PNG,svg,png,imagemagick,inkscape,Svg,Png,Imagemagick,Inkscape,这是我的SVG文件: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg2985"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="changeStatus.png">
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="11.197802"
inkscape:cx="-0.20853807"
inkscape:cy="16"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1330"
inkscape:window-height="780"
inkscape:window-x="2493"
inkscape:window-y="54"
inkscape:window-maximized="0" />
<defs
id="defs2987">
<marker
style="overflow:visible;"
id="Arrow2Mend5"
refX="0.0"
refY="0.0"
orient="auto"
inkscape:stockid="Arrow2Mend5">
<path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="stroke-linejoin:round;stroke:#9999cc;stroke-width:0.62500000;fill:#9999cc;fill-rule:evenodd"
id="path4232" />
</marker>
</defs>
<metadata
id="metadata2990">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
inkscape:label="Layer 1"
id="layer1">
<rect
ry="0"
y="2.1727178"
x="2.2176549"
height="7.412169"
width="28.003029"
id="rect2993"
style="fill:none;stroke:#9999cc;stroke-width:2;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
<rect
ry="0"
y="22.221294"
x="2.3409784"
height="7.412169"
width="28.003029"
id="rect2993-1"
style="fill:none;stroke:#9999cc;stroke-width:2;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" />
<path
inkscape:connector-curvature="0"
id="path3781"
d="m 15.98528,6.5033682 0,16.5092328"
style="fill:none;stroke:#9999cc;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:2;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend5)" />
</g>
</svg>
ImageMagic需要在SVG源代码中修改什么才能处理它?您可以将箭头转换为Inkscape中的路径。选择箭头,然后使用“笔划到路径”功能(可通过“路径->笔划到路径”或快捷键Ctrl-Alt-C访问)
如果将修改后的图形保存为svg,则可以通过ImageMagic进行转换 像这样的箭头通常在DEF中作为标记完成。Imagemagick在8年前就出现了标记问题,可能它从未得到修复,或者修复需要某种标志。我删除了所有的sodipodi和inkspace垃圾,但仍然存在相同的问题。如果
convert
存在问题,您可以在命令行中使用inkscape
呈现SVG文件。Anthony,inkscape的元数据永远不会出现问题,因为它位于不同的XML命名空间中。但实际上,有几个渲染器根本不支持标记。
convert -resize 32x32 -transparent white changeStatus.svg changeStatus.png