codice:
<%@ Page Language="VB" ContentType="image/jpeg" %>
<%@ 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 )
dim x1 as integer = 0
dim a as integer = r.Next( 155 )
dim x2 as integer = r.Next( 100 )
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( "Response.OutputStream Test", 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()
%>