Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我有一个SVG代码想要在浏览器上呈现,我知道它';在XML格式中,我使用了用于SVG的inkscape编辑器_Xml_Svg - Fatal编程技术网

我有一个SVG代码想要在浏览器上呈现,我知道它';在XML格式中,我使用了用于SVG的inkscape编辑器

我有一个SVG代码想要在浏览器上呈现,我知道它';在XML格式中,我使用了用于SVG的inkscape编辑器,xml,svg,Xml,Svg,我有一个SVG代码想要在浏览器上呈现它,我知道它是XML格式的,我使用了inkscape editor for SVG 实际的代码是大的,但如果我可以呈现这个,我可以做其余的。帮助将不胜感激 <!DOCTYPE html> <html lang="en"> <head> <head> <body> <?xml version="1.0" encoding="UTF-8" standa

我有一个SVG代码想要在浏览器上呈现它,我知道它是XML格式的,我使用了inkscape editor for SVG

实际的代码是大的,但如果我可以呈现这个,我可以做其余的。帮助将不胜感激

<!DOCTYPE html>

<html lang="en">
    <head>


    <head>


    <body>


     <?xml version="1.0" encoding="UTF-8" standalone="no"?>
   <!-- Created with Inkscape (http://www.inkscape.org/) -->

<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="744.09448819"
        height="1052.3622047"
        id="svg2"
        version="1.1"
        inkscape:version="0.48.4 r"
        sodipodi:docname="map.svg"
        inkscape:export-filename="C:\Users\Seva\Desktop\map.png"
        inkscape:export-xdpi="90"
        inkscape:export-ydpi="90">
 <defs
        id="defs4" />
        <sodipodi:namedview
        id="base"
        pagecolor="#ffffff"
        bordercolor="#666666"
        borderopacity="1.0"
        inkscape:pageopacity="0.0"
        inkscape:pageshadow="2"
        inkscape:zoom="0.04375"
        inkscape:cx="4115.2158"
        inkscape:cy="42.422884"
        inkscape:document-units="px"
        inkscape:current-layer="layer1"
        showgrid="false"
        inkscape:window-width="467"
        inkscape:window-height="419"
        inkscape:window-x="26"
        inkscape:window-y="26"
        inkscape:window-maximized="0" />
  <metadata
        id="metadata7">
        <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:label="Layer 1"
        inkscape:groupmode="layer"
        id="layer1">
<    rect
       style="fill:#aaebff;fill-opacity:1;stroke:#000e12;stroke-   width:21.07428932;stroke-        miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
    id="rect4055"
   width="3067.7397"
   height="73.105568"
   x="-1286.5527"
   y="-617.04779" />
<path
   sodipodi:type="arc"
                                                                      style="fill:#e0e91b;fill-opacity:1;stroke:#090000;stroke-width:17;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
   id="path2993"
   sodipodi:cx="-354.28571"
   sodipodi:cy="168.07646"
   sodipodi:rx="88.571426"
   sodipodi:ry="88.571426"
      d="m -265.71428,168.07646 a 88.571426,88.571426 0 1 1 -177.14285,0     88.571426,88.571426 0 1 1 177.14285,0 z"
   transform="matrix(1.608868,0,0,1.608868,-850.00101,-844.25513)" />

image/svg+xml


它可以工作。这只是规模问题。您只能可视化SVG图形的一个空部分。Inkscape使用了一些特定的配置参数(在
svg
标记中的属性
Inkscape:…
),浏览器不考虑这些参数。 通过很好地选择
viewBox
属性的参数,可以可视化您给出的代码中定义的形状

我只需更改属性
width
height
,并将
viewBox
一个添加到
svg
标记中,就可以在处获得工作示例



很抱歉,我对Inkscape不够熟悉,无法提出一种生成更多标准SVG文件的方法。也许你必须用普通SVG而不是Inkscape SVG保存文件。

请澄清你的问题是什么,你尝试了什么,并编辑你的标题:使它更简短、更有意义在通过inskscape生成的任何浏览器上渲染SVG我累了,它不起作用。如果没有整个文件,我们只会胡乱猜测出了什么问题。或者把你的HTML页面放在web上的某个地方,或者找到一个显示相同问题的小SVG,并将其发布到你的问题中。
<svg
...
viewBox="-2000 -100 6000 200"
width="400"
height="300">