总搞不明白VML中画SHAPE如何封闭

lkkjx 2006-08-25 03:19:58
我想以页面左上角为原点,画一个正方形 下面这种写法不对吗?
<v:shape id=vml2 style="Z-INDEX:3003;LEFT:0;WIDTH:1024;TOP:0;HEIGHT:768;POSITION:absolute" coordsize="1024,768" CoordOrig="0,0" filled="t" fillcolor="red" strokecolor="black" strokeweight="1px" path=" m 50,50 l 100,50,100,100,100,50,50 xe">
</v:shape>

m x,y:MoveTo把画笔移动到 (x,y);
l x,y:LineTo从当前点到(x,y)画一条线;可以给连续的几个点,VML会连续画出来直到遇到 x 命令。
x:Close结束一条线;
e:End结束画图
...全文
209 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
lkkjx 2006-08-28
  • 打赏
  • 举报
回复
可您的这段代码画不出一个 填充了的
----------
| /\ |
| / \ |
|/ \|
wuxinlangman 2006-08-28
  • 打赏
  • 举报
回复
那就<v:shape id=vml2 style="Z-INDEX:3003;LEFT:0px;WIDTH:1024px;POSITION:absolute;TOP:0px;HEIGHT:768px" CoordOrig="0,0" coordsize="1024,768" filled="t" fillcolor="red" strokecolor="black" strokeweight=".75pt" path=" m50,50 l100,50,100,100,50,50,0,100,50,50 xe">
</v:shape>
这个xe是他前面的这个坐标闭合
lkkjx 2006-08-28
  • 打赏
  • 举报
回复
谢谢,如果我想在50,50闭合 应当怎么做?
wuxinlangman 2006-08-28
  • 打赏
  • 举报
回复
<v:shape id=vml2 style="Z-INDEX:3003;LEFT:0px;WIDTH:1024px;POSITION:absolute;TOP:0px;HEIGHT:768px" CoordOrig="0,0" coordsize="1024,768" filled="t" fillcolor="red" strokecolor="black" strokeweight=".75pt" path=" m50,50 l100,50,100,100,50,50,0,100,0,50 xe">
</v:shape>
这个才是你要的效果你没有看吗?
wuxinlangman 2006-08-27
  • 打赏
  • 举报
回复
这个图开始点是50,50不是0,50
最后闭合的时候是到0,50闭合的
lkkjx 2006-08-26
  • 打赏
  • 举报
回复
m50,50
的意思不是把画笔移动到 (x,y)吗?为什么Y变了而X没有变呢?
wuxinlangman 2006-08-25
  • 打赏
  • 举报
回复
<v:shape id=vml2 style="Z-INDEX:3003;LEFT:0px;WIDTH:1024px;POSITION:absolute;TOP:0px;HEIGHT:768px" CoordOrig="0,0" coordsize="1024,768" filled="t" fillcolor="red" strokecolor="black" strokeweight=".75pt" path=" m50,50 l100,50,100,100,50,50,0,100,0,50 xe">
</v:shape>
这个才是你话的那种图形
lkkjx 2006-08-25
  • 打赏
  • 举报
回复
按理来说应当是这个形态
----------
| /\ |
| / \ |
|/ \|
lkkjx 2006-08-25
  • 打赏
  • 举报
回复
上面的写错了,我要做的是一个多边形
<v:shape id=vml2 style="Z-INDEX:3003;LEFT:0;WIDTH:1024;TOP:0;HEIGHT:768;POSITION:absolute" coordsize="1024,768" CoordOrig="0,0" filled="t" fillcolor="red" strokecolor="black" strokeweight="1px" path=" m 50,50 l 100,50,100,100,75,75 ,50,100 xe">


这代码画出来得有问题,在最后2个节点上
slayerbb 2006-08-25
  • 打赏
  • 举报
回复
Filled:是否要填充图形,如果图形不是封闭的,也会自动封闭图形进行填充。当Filled="true"(默认),fillcolor才有效果;

87,902

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧