Once, I wrote code to draw a captcha image, and this is how I got it on the page:
int imgHeight = 60;
int imgWidth = 160;
Bitmap objBMP = new System.Drawing.Bitmap(imgWidth, imgHeight);
Graphics objGraphics = System.Drawing.Graphics.FromImage(objBMP);
Response.ContentType = "image/GIF";
objBMP.Save(Response.OutputStream, ImageFormat.Gif);
objFont.Dispose();
objGraphics.Dispose();
objBMP.Dispose();