用js绘图

2016-01-29 12:10 0 1 收藏

用js绘图,用js绘图

【 tulaoshi.com - Java 】

  <object id=DirectDraw
classid="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
style="positiion:absolute;top:0;left:0;width:320;height:200"

<param name="line0001" value="绘图指令1"
<param name="line0002" value="绘图指令2"
...
</object
绘图指令分类:
(一)常见形状
1.矩形类 //rotation是以度为单位的旋转角度
Rect(x ,y, width, height, rotation) //矩形
Oval(x ,y, width, height, rotation) //椭圆
RoundRect(x ,y, width, height, arcWidth, arcHeight, rotation)
2.弧形类
Arc(x ,y, width, height, startAngle, arcAngle, rotation) //弧形
Pie(x ,y, width, height, startAngle, arcAngle, rotation) //饼图
3.多边形类
Polygon(nPoints, x1, y1, x2, y2, [x3, y3, ....], rotation) //闭合
Polyline(nPoints, x1, y1, x2, y2, [xn, yn, ....], rotation) //不闭合
(二)效果函数
1.线条效果
SetLineColor(r, g, b) //设置画线颜色
SetLineStyle(style) //style=(1:实线;2:虚线;0:隐藏)
2.填充效果
SetFillColor(r, g, b, backr, backg, backb)
SetFillStyle(style) //style=(1:实心;2:透明;3:-;4:|;5:;6:/;7:+;8:x)
(三)文字输出函数
SetFont('字体',width,height,r,g,b) //设置字体
Text('要输出的文字内容', x,y,z) //输出文字


控制函数 //定义<object后在<script</script里使用。
引用格式:DirectDraw.FunctionName()
rotate(x-rotation, y-rotation, z-rotation) //旋转
scale(x-scale,y-scale,z-scale) //缩放
translate(x-coordinate,y-coordinate,z-coordinate) //平移
setIdentity() //复原
clear() //清除,清除后无法恢复!

 

来源:https://www.tulaoshi.com/n/20160129/1484954.html

延伸阅读
标签: Web开发
document.write('DIV id="loadingg"  style="HEIGHT:65px; WIDTH: 200px;POSITION: absolute; Z-INDEX:1000;border:3px;solid;text-align:center;sans-serif;color:#000000;background-color:#FFFFFF;opacity:.7;-moz-opacity:.7;filter: Alpha(Opacity=75, FinishOpacity=50, Style=1,&nbs...
标签: ASP
  经常在ASP里面碰到要求用户输入日期,比如生日,那么如何知道他输入的值是否有效呢?比如输入2月,则肯定没有30,31号;又如她要是输入4月,那么肯定没有31号,等等..... 下面是我碰到时的解决方案,在ASP中实现: Tyear=parseInt(<%=year(date)%); Tmonth=parseInt(<%=month(date)%); Tday=parseInt(<%=day(date)%); &nb...
标签: 办公软件
我们在用WPS2005编辑文档时,有时需要为文字添加上划线。金山2003提供了上划线的功能,但在WPS2005中取消了这个功能,那么有没有快捷简单的方法为文字加上上划线呢?答案是肯定的,我们可以给文字画上上划线。具体步骤如下: 1、单击视图菜单中,在工具栏菜单中选中绘图。这样绘图菜单就出现在工具栏中,见图1: 图1 2、...
  有没有这种经历,当你打开一个链接的时候,浏览器窗口由小变大,呈现一个渐变的过程。下面,我们就来介绍这种动态效果的由来,大家可要看仔细了。 这种程式的思路就是先根据浏览器的可利用的宽度和高度,算出一个中心坐标点,然后每次都把窗口定位到这个点上,再算出相应窗口的变大尺寸,循环50次,从而最终回到浏览器最大化时...
标签: Web开发
大概是去年的时候吧,就在网上见过了现成的CSS圆角效果的CSS及HTML代码,例如: html head titlecss圆角效果/title meta http-equiv="content-type" content="text/html; charset=gb2312" style type="text/css" div.RoundedCorner{background: #9BD1FA} b.rtop, b.rbottom{display:block;background: ...

经验教程

463

收藏

27
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部