<% @ Page language = "vb" contenttype = "text / html" responseEncoding = "gb2312"%>
<% @ Import namespace = "system.drawing"%>
<% @ Import namespace = "system.drawing.imaging"%>
<% @ Import namespace = "system.drawing.drawing2d"%>
<%
Response.clear () 'Clearing buffer
Dim Height as integer = 100
Dim width as integer = 200
DIM R AS New Random 'establishes a random number
DIM X as integer = r.next (75) 'Generates a random number of 0-75
DIM x1 as integer = 0
Dim a as integer = r.next (155) 'Generates a random number of 0-155
DIM X2 AS INTEGER = R.NEXT (100) 'Generates a random number of 0-100
'Establish bitmap objects Bitmap, parameters are: width, high, pixel
DIM BMP As New Bitmap (Width, Height, Pixelformat.Format24bppRGB)
'
DIM G AS Graphics = graphics.fromimage (bmp)
g.smoothingmode = smoothingmode.ntialias
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 ("China Cross Design", 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)
'Image generation
Bmp.save (response.outputstream, imageformat.jpeg)
g.dispose ()
bmp.dispose ()
Response.end ()
%>