SVG坐标到VML坐标 [英] SVG coords to VML coords

查看:128
本文介绍了SVG坐标到VML坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有svg文件

<svg 
    xmlns="http://www.w3.org/2000/svg" 
    xml:space="preserve" width="200px" 
    height=""
    style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
    viewBox="0 0 69.1341 93.4405"
    xmlns:xlink="http://www.w3.org/1999/xlink">
...
<path class="fil3 str0" d="M49.1257 35.5851c3.029,0.890254 7.2612,0.610968 12.3164,-0.468419 -5.13373,3.85796 -12.1161,4.96333 -19.7673,5.07307"/>
... 
</svg>

我正在尝试将其手动转换为vml,而我得到的是

i am trying to convert it to vml manually and what i am getting is

<body>
...
<v:group style="position: absolute;
                left: 0pt;
                top: 0pt; 
                width: 200px;
                height: 200px;
                z-index: -56;"
                coordsize="100000 100000"
                coordorigin="0 0" id="Слой_x0020_1">

<v:shape path="m 491257,355851 nf v 30290,8903 72612,6110 123164,-4684 -51337,38580 -121161,49633 -197673,50731 e" 
   strokeweight="0.126615" 
   fill="false" 
   style="width: 200px; 
   height: 200px;" 
   coordorigin="-100000 -100000" 
   class="fil3 str0"></v:shape>
...
</body>

问题:我得到的图像比例不正确

The problem: i am getting image in a wrong scale

问题:如何将svg尺寸/坐标正确转换为vml尺寸/坐标

The question: how to convert svg dimensions/coords to vml dimensions/coords correctly

推荐答案

确定简单

我们有

<svg 
    xmlns="http://www.w3.org/2000/svg" 
    xml:space="preserve" width="200px" 
    height=""
    style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
    viewBox="0 0 69.1341 93.4405"
    xmlns:xlink="http://www.w3.org/1999/xlink">
...
<path class="fil3 str0" d="M49.1257 35.5851c3.029,0.890254 7.2612,0.610968 12.3164,-0.468419 -5.13373,3.85796 -12.1161,4.96333 -19.7673,5.07307"/>
... 
</svg>

69.1341/200 = 0.3456705

69.1341/200=0.3456705

回合(0.3456705 * 10000)= 3456

round(0.3456705*10000)=3456

每个像素3456个某些单位"

its a 3456 "some units" per pixel

在vml中,它等于"width:1px; height:1px"和coordsize ="3456 3456"

in vml its equals to "width:1px;height:1px" and coordsize="3456 3456"

结果

<body>
...
<v:group style="position: absolute;
                left: 0pt;
                top: 0pt; 
                width: 1px;
                height: 1px;
                z-index: -56;"
                coordsize="1 1"
                coordorigin="0 0" id="Слой_x0020_1">

<v:shape path="m 491257,355851 nf v 30290,8903 72612,6110 123164,-4684 -51337,38580 -121161,49633 -197673,50731 e" 
   strokeweight="0.126615" 
   fill="false" 
   style="width: 1px; height: 1px;" 
   coordorigin="-100000 -100000" 
   coordsize="3456 3456"
   class="fil3 str0"></v:shape>
...
</body>

这篇关于SVG坐标到VML坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆