Exforsys

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality

Ads


Home arrow Technical Training arrow ASP.NET 2.0

ASP.NET : Dynamic Image control

Author : Exforsys Inc.     Published on: 16th Sep 2005    |   Last Updated on: 16th Feb 2007

ASP.NET Dynamic Image control

In this tutorial you will learn how to create Dynamic Image Control, DynamicImage Control Properties and Custom Parameters.

Ads

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.



 
This tutorial is part of a ASP.NET 2.0 tutorial series. Read it from the beginning and learn yourself.

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality
 

Comments