Technical Training
ASP.NET 2.0ASP.NET : Dynamic Image control
ASP.NET Dynamic Image control
In this tutorial you will learn how to create Dynamic Image Control, DynamicImage Control Properties and Custom Parameters.
The DynamicImage control derives from the DynamicImageBase which is in turn derived from Image. This control acquires image bytes from varied sources and renders them to image capable devices using an internal normalization process. It stores the images in the System.Drawing.Image object and is cached in ASP.NET Cache with a randomly generated key. The HTML generates a < img > tag. The CachedImageService.axd URL is a built in HTTP handler which retrieves the image from the cache object and serializes its bytes to the browser using the proper content type. The data parameter of the Query handler string is used to select the image. The ImageUrl property can be used to find the URL of the image. The DynamicImage has the following properties.
- ID - ID of the server control
. - ImageGeneratorURL- The URL of our ImageGenerator .asix file which will build our image on the fly
. - ImageType - Automatic, Jpg, Gif, Bmp, Png
. - Height - Height of the image
. - Width- Width of the image
. - ParameterMode - ImageGenerationStorage (more secure) or QueryString
. - ForeColor - The font color of the text
. - BackColor - The back ground color of the image (only displays if a background image isn't supplied)
. - Image –an object of the System.Drawing.Image. It gets and sets the property of the image.
Custom Parameters
- Text - The text that should be displayed
. - Font - The font of the text
. - FontSize - Size of the text
. - FontStyle - Style of the font
. - xPoint - Where the text should be located along the X axis (0 is left most)
. - yPoint - Where the text should be located along the Y axis (0 is top most)
. - Image - Name of the image file that should be used as the background
The DesktopScaling property refers to resizing of the image on the desktop while MobileScaling refers to scaling the image on the mobile devices.
The DynamicImage control links to databases and to xml files. Images can also be dynamically generated using this control. The custom Image Generation Service can also be used. A file with the extension .asix is defined for the image generation services. Image generation handlers are defined at runtime and cached in server memory. The image generator takes a string and creates an image that represents it. Custom image generators can also be created by inheriting from ImageGenerator and overriding the RenderImage method. The image is referenced using the ImageGeneratorUrl property pointing to the ASIX handler. The image object can be received as a QueryString collection or the Parameters collection. This can be defined programmatically using the name/value interface.
In the next sections of this tutorial we shall examine the advanced site functionalities that have been built into ASP.NET 2.0.
ASP.NET 2.0
- Getting started with ASP.NET 2.0
- .NET Framework Fundamentals
- Microsoft.NET Framework Tools
- Application Development in .NET
- What's New in the .NET Framework 2.0 ?
- Introduction to Visual Studio.NET
- Installing Visual Studio.NET 2005
- Working with Visual Studio.NET Web Applications
- Whats New in ASP.NET 2.0
- Creating an ASP.NET Application
- ASP.NET Code Directory
- ASP.NET Page Object Model
- ASP.NET Server Controls
- ASP.NET Working With Master Pages
- ASP.NET Creating Content for Master Page
- ASP.NET Referencing Master Page Members
- ASP.NET Changing Master Pages Dynamically
- ASP.NET Creating Nested Master Pages
- ASP.NET Working with Web Parts
- ASP.NET Using Web Parts and Controls in Web Pages
- ASP.NET Web Pages and Layout
- ASP.NET - Adding Web Parts at Run Time
- ASP.NET Personalization: User Profiles and Themes
- ASP.NET Data Access features
- ASP.NET State Management
- ASP.NET Customizing the Session State Mechanism
- ASP.NET State Management And Caching
- ASP.NET Security
- Forms Authentication in ASP.NET
- ASP.NET Managing Membership and Roles
- ASP.NET Configuring Page-Level Caching
- ASP.NET Setting Application-Level Caching
- ASP.NET Data Source Object Model
- ASP.NET SqlDataSource Control
- ASP.NET Data Bound Controls
- ASP.NET GridView Control
- ASP.NET GridView Filtering
- ASP.NET Adding Sorting and Paging in GridView
- ASP.NET DataBound Controls - Details View
- ASP.NET Using a Grid to Display Detail Information
- ASP.NET Displaying Master-Detail Data on the Same Page
- Displaying Master-Detail Data on Separate Pages in ASP.NET
- ASP.NET Creating Web Wizards
- ASP.NET : Dynamic Image control
- ASP.NET Advanced Site Functionality







