Introduction
Before the advent of the .Net framework, creating images on the fly for a web
browser was a tedious task. Now, thanks to the .Net framework, creating images
on the fly is a simple task. This article will provide the reader with the fundamentals
necessary to start developing dynamic images with the .Net framework.
Creating dynamic images with the .Net framework is a four-step process. First,
set the content-type of the aspx file to an image type. Second, get an instance
of the Graphics object from a Bitmap. Third, draw on the Graphics object. Four,
save the Bitmap to an output stream.
The default content-type value for an aspx file is "text/html".
If we want to output an image, say an GIF, we need to set the content-type to
"image/gif". We simply add the following to the top of
our aspx page.
<%@ Page ContentType = "image/gif"%>