Last week's article - Dynamically Generating and Caching Images in ASP.NET with the GeneratedImage Control
- looked at how to programmatically create and cache images on the fly using the GeneratedImage control, one of a suite of "Futures" technologies found in
the ASP.NET Team's CodePlex site. Programmatically creating and displaying images entails the use of an HTTP Handler for generating the binary
content of the dynamically-generated image. While this HTTP Handler can be implemented as an ASP.NET page, the GeneratedImage control includes the ImageHandler
class, which serves as a base class for HTTP Handlers designed specifically to generate and serve dynamic images and includes built-in functionality for caching images on the
client and/or web server. Last week's article illustrated both how to create an HTTP Handler for generating dynamic images (one that extended ImageHandler) as
well as how to use the GeneratedImage Web control to display such dynamically-generated images in a web page.
In addition to its image generation and caching features, the ImageHandler class includes functionality for performing image transforms. An image
transformation is a process that takes an image as input, modifies it in some way, and outputs the modified image. Common image transformations include image resizing,
changing the image's color information (such as transforming a color image into a black and white one), and adding a watermark to the image. What's more, transformations can
be chained together. For example, you could take an original image and feed in into the resize transformation. The output of the resize transformation could then be used as
the input of the watermark transformation, which would then output the resized image with a watermark.
The GeneratedImage control ships with an image transform class that resizes the original image, as well as an ImageTransform class that serves as a base class
for creating your own image transform classes. This article illustrates how to use resize dynamically-created images on the fly as well as how to create your own image transform
classes. Read on to learn more!
Read More >