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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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: 4 stars4 stars4 stars4 stars4 stars / 3
    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

    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...
    - Building an In-Text Advertising System Under...
    - Developing a Mini ASP.NET AJAX Server Centri...





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