您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> asp >> 正文

ASP Image 使用范例

作者:佚名    信息学院来源:整理    点击数:    更新时间:2008-1-24 我要参与讨论

 

   使用ASPImage组件仅需以下步骤:
  
  建一个对象
  设置若干属性
  调用SaveImage方法
  以下代码举例说明如何在vbscript中使用ASPImage组件,在这个例子中我们要建立一个渐进填充的字样为 "welcome to"的文字图片:
  Set Image = Server.CreateObject("AspImage.Image")
  
  rem Set various font parameters
  Image.FontColor = vbBlack
  Image.Italic = True
  Image.Bold = True
  Image.FontName = "Arial"
  Image.FontSize = 12
  Image.PadSize = 10
  
  rem Calculate how big our text info is and set the image to this size
  remThis has to be done since we want to fill the area with a gradient
  strMessage = "Welcome to"
  Image.MaxX = Image.TextWidth (strMessage)
  Image.MaxY = Image.TextHeight (strMessage)
  
  rem Create a one way gradient
  Image.GradientOneWay vbRed, vbWhite, 0
  
  rem Print our string to the image
  Image.TextOut strMessage, Image.X, Image.Y, false
  
  rem Set the filename and save
  remNOTE: You should gen the filename dynamically for multiuser usage
  Image.FileName = "d:inetpubwwwrootimagesmsg1.jpg"
  if Image.SaveImage then
  rem The image was saved so write the <img src> tag out for the browser to pick up
  Response.Write "<img src="http://www.ddvip.net/web/ASP/searches/"/images/msg1.jpg""><br>"

[1] [2] 下一页

在google里搜索更多ASP Image 使用范例

Google
Web www.51ec.org
【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
我来说两句 对此文章发表了评论
  昵 称: *必填    ·注册用户·
  评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
评 论
内 容

 
评论列表 (最新 评论仅限网友观点!)

供求信息




| 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明