教程学院
图像设计 多媒体类 机械制图 办公软件 操作系统 系统编程 网站编程 网页制作 数据库类 网络路由 网络工程 网络安全 考试认证
酷网学院
CAD
AutoCad Cam350 ProEngineer GCcam MATLAB Unigraphics SolidWorks CAXA Solid3000 Cimatron EdgeCAM
系统
安全 防火墙 病毒 WinXP Win2003 Vista
数据库
编程
网络
精彩图库
  当前位置: 库库中文网 · 网站编程教程 · ASP教程 · ASP基础教程

ShotGraph普通地画图地机制

学院最新推荐文章
教程推荐
『ShotGraph普通地画图地机制』如果文章有大量图片,显示会较慢,请等待图片下载完成
 
点击数: 更新时间:2005-11-19 
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代码:
  • 上载文件
  • 计数器
  • 画GIF动画图形
  • 画图形

我们来先来简单的:

Step by step

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

The size of the image is 201x201.
VBScript 中的代码:
'Creating the objectset obj=CreateObject("shotgraph.image")size=201'Calling the CreateImage methodobj.CreateImage size,size,4'Set 4 colors for drawingobj.SetColor 0,255,255,255obj.SetColor 1,0,0,0obj.SetColor 2,255,108,0obj.SetColor 3,0,0,204'Crearing the painting area with color 0obj.SetBgColor 0obj.FillRect 0,0,size-1,size-1'Color 0 will be used for drawingobj.SetDrawColor 1'Drawing the lineobj.Line size-1,0,0,size-1'Color 2 will be used for fillingobj.SetBgColor 2'Draw the big circleobj.Ellipse 5,5,size-6,size-6'Color 2 will be used for fillingobj.SetBgColor 3'Draw the small circleobj.Ellipse 5,(size-5)/4,size/2,(size-5)*3/4'Create 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")
】【关闭窗口
·上页:
·下页:
相关文章
     网站编程教程 - ASP基础教程
推荐教程ASP.NET初步掌握随想之吸星大法
推荐教程ASP.NET地工作机制(2)
推荐教程二级域名机制以及程序
推荐教程蛙蛙推荐:面向对象编制程序基本
推荐教程二级域名机制以及程序代码
推荐教程简单介绍Asp程序地设计和调整测
推荐教程ShotGraph普通地画图地机制
推荐教程二级域名机制以及程序,申请即
推荐教程运用VC++6.0绘制ASP服务器控件
推荐教程IIS5.0建网站—〉第一章 Win 2
推荐教程IIS5.0建网站—〉第一章 Win 2
推荐教程IIs5.0建网站--〉第三章  WWW服
精彩图片汇集
advertisement
关于站点 - 广告服务 - 联系我们 - 版权隐私 - 免责声明 - 合作伙伴 - 程序支持 - 网站地图 - 返回顶部
网站文本地图
版权所有:库库中文 2005-2007 欢迎各种媒体转载我们的原创作品[转载请注明出处]
copyright © 2005-2008 www.QQGB.com online services. all rights reserved. 蜀ICP备05015578
Template designed by Virus. Optimized for 1024x768 to Firefox,Opera and MS-IE6. Site powered by EQL.
红盾
热爱电脑,热爱生活
拥有电脑,拥有生命
让我们享受拥有电脑的时光