ASP.NET
  Home arrow ASP.NET arrow Page 2 - Playing with Images in ASP.NET 3.5 AJAX Ap...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Playing with Images in ASP.NET 3.5 AJAX Applications
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-08-26

    Table of Contents:
  • Playing with Images in ASP.NET 3.5 AJAX Applications
  • Hacking the HTML
  • A Few words about the HTTP Handler
  • Loading Images from an Assembly
  • Accessing Images from a SQL Server Database

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Playing with Images in ASP.NET 3.5 AJAX Applications - Hacking the HTML


    (Page 2 of 5 )

    On the whole, there is merely one way to refer to an image in an HTML page-using the HTML <img> element. The following lists the simple and typical form of usage for the <img> mark:

    <img id="ImgID"
    alt="alternate text for the image"
    align="top|middle|bottom|left|right"
    border="border width"
    height="image height"
    src="the url to the special image file"
    width="image width" />

    Author's Note: in the case of Microsoft Internet Explorer, the <img> mark is designed to embed both an image and a video clip in a web page. When using the img element to display a static image, specify the URL of the image file with the src attribute. When using the img element to display a video clip or virtual reality modeling language (VRML) world, specify the URL with the dynsrc attribute. Regrettably, due to the well-known incompatibility between browsers, Mozilla Firefox does not support the video clip functionality.

    To show an image at the web page you have to provide the corresponding URL that identifies an image. In many cases, the URL points to a static image resource, such as an .gif, .png or .jpeg file. The following concludes the entire image and video file formats supported by IE:

    .avi-Audio-Visual Interleaved (AVI)

    .bmp-Windows Bitmap (BMP)

    .emf-Windows Enhanced Metafile (EMF)

    .gif-Graphics Interchange Format (GIF)

    .jpg, .jpeg-Joint Photographic Experts Group (JPEG)

    .mov-Apple QuickTime Movie (MOV)

    .mpg, .mpeg-Motion Picture Experts Group (MPEG)

    .png-Portable Network Graphics (PNG)

    .wmf-Windows Metafile (WMF)

    Note in the "static" resource scenarios, the web server can serve incoming requests of this kind internally, independent of the out-most components. However, this is only one of the cases; the image data in practical situations for the <img> element may reside in other kinds of storage media, such as databases, .NET assemblies, or even the memory of the web servers.

    In ASP.NET, the HtmlImage class is utilized to describe and render the <img> mark; however, besides providing more flexible control over the images, this merely means one of many possible ways to create the <img> mark. Another apparent alternate method to rendering an image on a web page is to leverage the original html <img> element.

    Digging more into the inner workings behind the exterior <img> mark, we should notice that the URL of an <img> mark can point to more than an static and direct path of an image in order to render an image on the web page. Suppose the URL points to an .aspx page. The web server will run the specified page and dispatch the final result to this attribute. Experiments show that as long as this result is pointing to some valid image format, it can be rendered onto the screen.

    More ASP.NET Articles
    More By Xianzhong Zhu


     

    ASP.NET ARTICLES

    - Developing a Mini ASP.NET AJAX Server Centri...
    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT