<%@ page language="vb" contenttype="text/html" responseencoding="gb2312" %>
<%@ import namespace="system.drawing"%>
<%@ import namespace="system.drawing.imaging"%>
<%@ import namespace="system.drawing.drawing2d"%>
<%
response.clear() '清空缓冲区
dim height as integer=100
dim width as integer=200
dim r as new random '建立随机数对像
dim x as integer =r.next(75) '产生0-75的随机数
dim x1 as integer =0
dim a as integer=r.next(155) '产生0-155的随机数
dim x2 as integer=r.next(100) '产生0-100的随机数
'建立位图对像bitmap,参数为:宽,高,像素
dim bmp as new bitmap(width,height,pixelformat.format24bpprgb)
'图片设置
dim g as graphics=graphics.fromimage(bmp)
g.smoothingmode=smoothingmode.antialias
g.clear(color.lightgray)
g.drawrectangle(pens.white,1,1,width-3,height-3)
g.drawrectangle(pens.gray,2,2,width-3,height-3)
g.drawrectangle(pens.black,0,0,width,height)
g.drawstring(" 中国横渡设计",new font("arial",10,fontstyle.bold),systembrushes.windowtext,new pointf(10,50))
g.fillrectangle(new solidbrush(color.fromargb(a,255,128,255)),x,20,100,50)
g.fillrectangle(new lineargradientbrush(new point(x2,0),new point(x2+75,50+30),color.fromargb(128,0,0,128),color.fromargb(255,255,255,240)),x2,50,75,30)
'图像生成
bmp.save(response.outputstream,imageformat.jpeg)
g.dispose()
bmp.dispose()
response.end()
%>