<%@ Page language="c#" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Text" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Bitmap OutputBitmap = new Bitmap(320,200);
Graphics DrawGraphic = Graphics.FromImage(OutputBitmap);
DrawGraphic.Clear(Color.Beige);
DrawGraphic.SmoothingMode = SmoothingMode.AntiAlias;
DrawGraphic.TextRenderingHint = TextRenderingHint.AntiAlias;
String MessageString = System.DateTime.Now.ToString();
DrawGraphic.DrawString(MessageString,
new Font("arial",18,FontStyle.Bold),
Brushes.DarkBlue, new PointF(20,20));
Response.Clear();
Response.ContentType="image/jpeg";
OutputBitmap.Save(Response.OutputStream, ImageFormat.Jpeg);
OutputBitmap.Dispose();
DrawGraphic.Dispose();
}
</script>