可以使用VML。http://www.txiang88.com/vml/
解决方案 »
- //api.pinterest.com/v1/urls/count.json?callback=receiveCount&url=' + targetUrl +
- js判断checkbox选中和禁用
- 求助JavaScript注册表单
- dojo的tree node如何动态加载
- JavaScript怎么把值写入文本框
- js打印问题,希望高手解决
- 传值问题
- 如果要在<body onload="...">时同时执行两个function,如何写呢?
- 求助! 那位老兄有 Javascript 和 flash之间通信 的例子,请求提供!!!
- 有谁可以给我解释以下这些代码是什么意思?
- 如何用javascript实现gb2312转utf-8
- ??我要动态改变iframe的location,在location完全加载完之后我要执行一些方法,怎么弄啊???
风云舞:FlashVml(璀灿之星)4.0发布 一般的精度不高的图形可以满足
var yo = 0
var Ox = -1
var Oy = -1
var rad = Math.PI/180
var maxY = 400
function print(str)
{
document.write(str);
}function outPlot(x,y,w,h)
{
print('<span style="position:absolute;left:'+x+';top:'+y+';height:'+h+';width:'+w+';font-size:1px;background-color:'+color+'"></span>');
}function Plot(x,y)
{
outPlot(x,y,1,1)
if(Ox>=0 || Oy>=0)
{
ShowLine(Ox,Oy,x-Ox,y-Oy)
}
Ox = x
Oy = y
}function ShowLine(x,y,w,h)
{
if(w<0)
{
x += w
w = Math.abs(w)
}
if(h<0)
{
y += h
h = Math.abs(h)
}
if(w<1) w=1
if(h<1) h=1
outPlot(x,y,Math.round(w),Math.round(h))
}function LineTo(x,y)
{
Line(xo,yo,x,y)
}function sign(n)
{
if(n>0)
return 1
if(n<0)
return -1
return n
}function Line(x1,y1,x2,y2)
{
x2 = Math.round(x2)
y2 = Math.round(y2)
xo = x2
yo = y2
var str = ""
var i=0
var x = x1
var y = y1
dx = Math.abs(x2-x1)
dy = Math.abs(y2-y1)
s1 = sign(x2-x1)
s2 = sign(y2-y1)
if(dx==0 || dy==0)
{
ShowLine(x1,y1,x2-x1,y2-y1)
return
}
if(dx>dy)
{
temp = dx
dx = dy
dy = temp
key = 1
}
else
key = 0
e = 2*dy-dx
for(i=0;i<dx;i++)
{
px = 0
py = 0
Plot(x,y)
while(e>=0)
{
if(key==1)
{
x += s1
px += s1
}
else
{
y += s2
py += s2
}
e = e-2*dx
}
if(key==1)
y += s2
else
x += s1
e = e+2*dy
}
} function MoveTo(x,y)
{
Ox = Oy = -1;
xo = Math.round(x);
yo = Math.round(y);
}function Arc(x,y,r,a1,a2)
{
MoveTo(r*Math.cos(a1*rad)+x,r*Math.sin(a1*rad)+y);
for(i=a1;i<=a2;i=i+2)
{
LineTo(r*Math.cos(i*rad)+x,r*Math.sin(i*rad)+y);
}
}
MoveTo(20,20)
LineTo(40,100)//画出直线
Arc(50,50,40,0,360)//画园,注意,后面两个参数必须是0,360,不要改动。
如果你要画矩形,就画四条直线表示就可以了。
function Rectangle(start_x,start_y,end_x,end_y)
{
MoveTo(start_x,start_y)
LineTo(end_x,start_y)
MoveTo(end_x,start_y)
LineTo(end_x,end_y)
MoveTo(end_x,end_y)
LineTo(start_x,end_y)
MoveTo(start_x,end_y)
LineTo(start_x,start_y)
}
调用这个函数,就可以画出矩形了。
参数分别是左上角点的坐标和右下角点的坐标