V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wsguest
V2EX  ›  GitHub

Github 程序员车贴-矢量图

  •  
  •   wsguest · 2018-06-05 16:54:28 +08:00 · 2327 次点击
    这是一个创建于 2365 天前的主题,其中的信息可能已经有所发展或是发生改变。

    完整代码:

    
    <svg width="1600" height="280" xmlns="http://www.w3.org/2000/svg">
     <g>
      <title>background</title>
      <rect x="0" y="0" width="1600" height="280" id="canvas_background" fill="#4682b4" stroke="null"/>
     </g>
     <g>
      <title>Layer 1</title>
      <path stroke="null" fill="#ffffff" id="svg_2" d="m126.511661,25.008311c-62.709419,0 -113.501211,50.791792 -113.501211,113.501211c0,50.224286 32.489722,92.645363 77.606453,107.684273c5.675061,0.993136 7.803208,-2.411901 7.803208,-5.391307c0,-2.695654 -0.141877,-11.633874 -0.141877,-21.1396c-28.517179,5.249431 -35.894758,-6.951949 -38.164782,-13.336392c-1.276889,-3.26316 -6.810073,-13.336392 -11.633874,-16.032046c-3.972542,-2.128148 -9.647603,-7.377579 -0.141877,-7.519455c8.93822,-0.141877 15.322663,8.228838 17.450811,11.633874c10.215109,17.167058 26.530908,12.343257 33.057228,9.36385c0.993136,-7.377579 3.972542,-12.343257 7.235702,-15.180787c-25.254019,-2.83753 -51.643051,-12.62701 -51.643051,-56.041223c0,-12.343257 4.398172,-22.558366 11.633874,-30.50345c-1.135012,-2.83753 -5.107554,-14.471404 1.135012,-30.077821c0,0 9.505726,-2.979407 31.212833,11.633874c9.080097,-2.553777 18.7277,-3.830666 28.375303,-3.830666c9.647603,0 19.295206,1.276889 28.375303,3.830666c21.707107,-14.755157 31.212833,-11.633874 31.212833,-11.633874c6.242567,15.606416 2.270024,27.240291 1.135012,30.077821c7.235702,7.945085 11.633874,18.018317 11.633874,30.50345c0,43.55609 -26.530908,53.203692 -51.784927,56.041223c4.114419,3.546913 7.661332,10.356985 7.661332,20.997724c0,15.180787 -0.141877,27.382167 -0.141877,31.212833c0,2.979407 2.128148,6.52632 7.803208,5.391307a113.68565,113.68565 0 0 0 77.3227,-107.684273c0,-62.709419 -50.791792,-113.501211 -113.501211,-113.501211z" fill-rule="evenodd"/>
      <text font-weight="bold" opacity="1" stroke="null" transform="matrix(8.61629668911245,0,0,7.906031641578541,-3089.657722508392,-2029.4437800737987) " xml:space="preserve" text-anchor="start" font-family="'League Gothic', sans-serif" font-size="24" id="svg_3" y="284.049199" x="389.104976" stroke-opacity="null" stroke-width="0" fill="#ffffff">Hello World!</text>
     </g>
    </svg>
    

    不能传图片吗?

    5 条回复    2018-06-05 18:15:23 +08:00
    wsguest
        1
    wsguest  
    OP
       2018-06-05 17:00:37 +08:00
    拷贝存为 svg 文件,浏览器打开。不会传图片
    mcfog
        2
    mcfog  
       2018-06-05 17:04:48 +08:00
    懒得保存的同学可以用这个

    document.write(`<img src="data:image/svg+xml;base64,${btoa(`SVG`)}">`)

    SVG 处粘贴 svg 即可
    allen6699
        3
    allen6699  
       2018-06-05 17:46:34 +08:00
    谁能做出成品来 贴车上
    dong3580
        4
    dong3580  
       2018-06-05 17:49:40 +08:00
    @allen6699
    蓝色背景,章鱼 logo,右边 Hello World! 几个字... 上古风格...
    luoway
        5
    luoway  
       2018-06-05 18:15:23 +08:00   ❤️ 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3591 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 11:13 · PVG 19:13 · LAX 03:13 · JFK 06:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.