Playing with Images in ASP.NET 3.5 AJAX Applications
(Page 1 of 5 )
In this long article, you will learn nearly all the image related problems under the newest ASP.NET 3.5 AJAX environments, and how to deal with them. This article is the first of two parts.
First, to test the sample applications provided in this article, it is highly recommended that you install the following:
- Windows XP Professional or higher versions (built-in support for GDI+ 1.0).
- Microsoft Visual Studio 2008 (ASP.NET 3.5 provided the built-in support for ASP.NET AJAX Extensions).
- Microsoft SQL Server 2005 or higher, with the sample database AdventureWorks_Data.mdf installed.
- ASP.NET AJAX Control Toolkit, which is required for the last sample in this article.
Second, to follow along with all the samples in this article, it is strongly suggested that you download the source files accompanying this article.
Finally, because the sample database AdventureWorks_Data.mdf is huge (more than 160Mb), I have removed it in the source code that comes with this article.
Introduction
Nowadays, images are spreading all over the Internet. Can you image what the Internet without image support would look like? Therefore, image, as with any other kind of data, is becoming more of a necessary item for nearly all ASP.NET developers. However, unlike the inner workings with general Windows desktop applications, due to the limited bandwidth of the current Internet and the no-state characteristic of HTTP protocol, rendering images in an ASP.NET application usually requires a special image toolkit or third party support. Delightfully, with the new image engine of GDI+ and the earthshaking ASP.NET 2.0 coming into the market, ASP.NET developers can easily deal with images in the web application scenario.
On the one hand, it is clear that images aren't always deployed in the web field. On the other hand, in many web applications, images play a crucial role, as important as any other kind of data in web applications such as tour guides, finance and economics analyses, and photography exhibitions. In these cases, these applications probably require image data to be generated and rendered dynamically, or processed with a distinguishing mark (such as a watermark or copyright information).
On the other hand, GDI+ is the new interface for drawing Windows graphics, which drastically simplifies the image process. It used to required complex and additional work in the days of plain GDI, but with GDI+ came a set of new concepts and classes. In the old days, to deal with images flexibly, you often have to fall back on the third party's web image toolkit or libraries. Thanks to GDI+, ASP.NET developers can now accomplish nearly any image-associated tasks individually without needing additional image tools or libraries.
In this article, I will lead you systematically through nearly all the image process related concerns under the ASP.NET 3.5 environment through several typical samples, especially laying emphasis upon GDI+ support with process images. What's more, you can learn how to deal with images under popular AJAX environments in combination with Microsoft's ASP.NET 3.5.
Next: Hacking the HTML >>
More ASP.NET Articles
More By Xianzhong Zhu