Image Generation is released to CodePlex

I'm really happy to announce that earlier this week we released a new feature called Image Generation to the ASP.NET CodePlex site. You can get a link directly to the page supporting this feature by clicking on: https://www.codeplex.com/aspnet/Wiki/View.aspx?title=WebForms&referringTitle=Home.

 

There was a feature that was in Beta 1 for Visual Studio 2005 (Whitbey) called DynamicImage that provided a control for generating images and an image service for serving them. This feature was sadly cut because some of the other parts of the framework it depended on were cut.

 

Image Generation is basically work to bring this type of feature back into the framework. Here are some of the highlights of what this new feature does:

 

New GeneratedImage ASP.NET control. This control is a derivative of asp:Image control that supports being hooked up to an Image Handler and passing parameters to it. If you put this control on a page and go into design mode it will have chrome attached to it that when clicked will automatically generate an ImageHandler and wire the control to the URL of the ImageHandler. Parameters such as the primary id and timestamp can be databound to the control and will automatically be passed to the handler.

 

ImageHandler which is an implementation of IHttpHandler that provides support for many image based things:

  • Transforms (resizing, watermarks, user defined transforms)
  • Client-side caching
  • Server side caching
  • Access to parameters passed from the GeneratedImage control
  • Provide simple mechanics for returning images

 

If you click to the site there are three samples of how to use GeneratedImage:

  • Simple Generated Image - this shows how you would create a simple bitmap and return it
  • Databased Images - shows how you would use this feature to display images that are stored in a database
  • Custom Image Transforms - shows how to write a custom image transform that adds a ASP.NET logo to an image

We are considering adding this feature in the next version of .NET and would love feedback. Please download and try and it out and let us know what you think!