简体   繁体   中英

SVG Image Generate

Have tried below code to generate SVG image

<path fill="transparent" stroke="#000" stroke-width="1.5"
            d="M15 3
               Q16.5 6.8 25 18
               A12.8 12.8 0 1 1 5 18
               Q13.5 6.8 15 3z" />

    var pat = "M"+15+" "+3+" "+ "Q"+ 16.5 +" "+6.8+ " " + 25 + " " +18+ " "+"A" + 12.8 + " " + 12.8+ " " + 0 + " " + 1  + " " + 1 + " " + 5  + " " +18+ " " +"Q" + 13.5 + " " + 6.8 + " " + 15 + " " + 3 + "Z";

      e.append("path").attr("d", pat); 

and got below image在此处输入图片说明

But i need this image

在此处输入图片说明

What should i do to make it as same as second image.

After trying so many coordinates value i found the exact coordinate for creating drop svg

Here is the code:

<svg height="1010" width="500">
<path fill="transparent" stroke="#000" stroke-width="1.5"
        d="M297.5 3        
           Q297.5 6.8 410.5 150           
           A120.8 102.8 0 1 1 210 148           
           Q297.5 6.8 297.5 3z"       
           />
</svg>

Happy coding !!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM