欢迎光临
我们一直在努力

ShotGraph普通的画图的原理

建站超值云服务器,限时71元/月

shotgraph 能在以下的环境中使用:

  • visual basic
  • vbscript
  • visual basic for applications (vba), word, excel, etc.
  • active server pages (asp) engine with internet information server
  • perl for windows
  • others

shotgraphcool代码:

我们来先来简单的:

step by step

  1. 首先建立一个对象 "shotgraph.image".
  2. 使用 createimage 方法。
  3. 使用 setcolor 方法一次或者多次来定义画图要使用的颜色。
  4. 清除你图区中的所有内容,必要时使用 fillrect 普遍认为方法.
  5. 使用有效的方法画图.
  6. 使用 gifimage 函数. 你的图画就完成了!
下面的是一个简单的例子来说怎样用 shotgraph画图。

the size of the image is 201×201.

vbscript 中的代码:
creating the objectset obj=createobject("shotgraph.image")size=201calling the createimage methodobj.createimage size,size,4set 4 colors for drawingobj.setcolor 0,255,255,255obj.setcolor 1,0,0,0obj.setcolor 2,255,108,0obj.setcolor 3,0,0,204crearing the painting area with color 0obj.setbgcolor 0obj.fillrect 0,0,size-1,size-1color 0 will be used for drawingobj.setdrawcolor 1drawing the lineobj.line size-1,0,0,size-1color 2 will be used for fillingobj.setbgcolor 2draw the big circleobj.ellipse 5,5,size-6,size-6color 2 will be used for fillingobj.setbgcolor 3draw the small circleobj.ellipse 5,(size-5)/4,size/2,(size-5)*3/4create the image file named test.gifobj.gifimage 0,1,"test.gif"
下面是在asp和perl中的代码:
aspperl
response.contenttype="image/gif"set obj=server.createobject("shotgraph.image")size=201obj.createimage size,size,4obj.setcolor 0,255,255,255obj.setcolor 1,0,0,0obj.setcolor 2,255,108,0obj.setcolor 3,0,0,204obj.setbgcolor 0obj.fillrect 0,0,size-1,size-1obj.setdrawcolor 1obj.line size-1,0,0,size-1obj.setbgcolor 2obj.ellipse 5,5,size-6,size-6obj.setbgcolor 3obj.ellipse 5,(size-5)/4,size/2,(size-5)*3/4img=obj.gifimage(0,1,"")response.binarywrite img
$obj=createobject("shotgraph.image")$size=201$obj->createimage($size,$size,4)$obj->setcolor(0,255,255,255)$obj->setcolor(1,0,0,0)$obj->setcolor(2,255,108,0)$obj->setcolor(3,0,0,204)$obj->setbgcolor(0)$obj->fillrect(0,0,$size-1,$size-1)$obj->setdrawcolor(1)$obj->line($size-1,0,0,$size-1)$obj->setbgcolor(2)$obj->ellipse(5,5,$size-6,$size-6)$obj->setbgcolor(3)$obj->ellipse(5,($size-5)/4,$size/2,($size-5)*3/4)$obj->gifimage(0,1,"test.gif")
赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » ShotGraph普通的画图的原理
分享到: 更多 (0)