标题:[转载]Vml_JS画的图形[金刚石篇]
只看楼主
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
结帖率:100%
 问题点数:0 回复次数:1 
[转载]Vml_JS画的图形[金刚石篇]

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head></head>
<STYLE>
v\:* { BEHAVIOR: url(#default#VML) }
</STYLE>
<body>

<v:group ID="group1" style="position:relative;WIDTH:800px;HEIGHT:600px;"

CoordOrig="-500,-500" coordsize="1000,1000">
<v:RoundRect style="position:relative;z-index:1;left:-600px;top:-

100;width:900px;height:900px" fillcolor="#cccccc">
<v:shadow on="T" type="single" color="#b3b3b3" offset="5px,5px"/>
</v:RoundRect>
<script>

function line(x, y, x1, y1, n)
{
document.write("<v:line from=\"" + (x - n) + "," + y + "\" to=\"" + (x1 - n) +

"," + y1 + "\" style=\"position:relative;top:0;left:0;z-index:9999;\"

strokeweight=\"1pt\"></v:line>");
// StrokeColor=Rgb(\"" + Math.round(Math.random() * 255 ) + "," + Math.round

(Math.random() * 255) + "," + Math.round(Math.random() * 255 ) +")
}

var n = 30, r = 346, t = 6.28318 / n, x0 = 300, y0 = 300;

var x = new Array();
var y = new Array();

for (var i = 0; i < n; i++)
{
x[i] = r * Math.cos(i * t) + x0;
y[i] = r * Math.sin(i * t) + y0;
}
for (var i = 0; i < n - 2; i++)
for (var j = i + 1; j <= n - 1; j++)
line(x[i], y[i], x[j], y[j], 500);
</script>

</v:group>
</body>
</html>

搜索更多相关主题的帖子: 图形 Vml 金刚石 relative 
2007-07-13 16:21
udbyygy
Rank: 1
等 级:新手上路
威 望:2
帖 子:226
专家分:0
注 册:2007-6-26
得分:0 

2007-07-13 17:08



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-155127-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.133664 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved