问题描述
- Raphael.js用path方法绘制图。是怎么做到的?
-
比如path方法中的数据是怎么得到的:
http://raphaeljs.com/icons/#customer
解决方案
查看源代码
比如:
<path fill="url(#48490-_0050af-_002c62)" stroke="none" d="M22.646,19.307C23.606,17.724,24.169,15.871999999999998,24.17,13.886C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885C3.204,19.674,7.897,24.366,13.688,24.366C15.675,24.366,17.527,23.803,19.11,22.843L26.238,29.97L29.773,26.433L22.646,19.307ZM13.688,20.369C10.106000000000002,20.361,7.210000000000001,17.465,7.204000000000001,13.885C7.210000000000001,10.303,10.107000000000001,7.407,13.688,7.399C17.267,7.407,20.166,10.303,20.172,13.885C20.165,17.465,17.267,20.361,13.688,20.369ZM15.687,9.051H11.687V11.884H8.854V15.885000000000002H11.687V18.718000000000004H15.687V15.884000000000004H18.519V11.885000000000003H15.685999999999998V9.051Z" transform="matrix(1,0,0,1,4,4)" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0); opacity: 1; fill-opacity: 1;" opacity="1" fill-opacity="1"></path>
解决方案二:
软件可以导出SVG格式的,里面自动转换成路径,比如你用PhotoShop做好,然后选择导出或存成SVG格式,就可以得到路径了。
另外像Vector Magic这样的软件,可以将图片自动转换成矢量图,存成SVG格式的时候,也可以得到路径。
时间: 2024-10-27 10:05:57