HTML
  Home arrow HTML arrow Page 3 - Maximizing and Restoring Images in a Tabul...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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? 
HTML

Maximizing and Restoring Images in a Tabular Database Form in HTML
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-10-01

    Table of Contents:
  • Maximizing and Restoring Images in a Tabular Database Form in HTML
  • Image Tags
  • Second Method of Maximizing and Restoring
  • Final Comments on the Client Side Design

  • 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


    Maximizing and Restoring Images in a Tabular Database Form in HTML - Second Method of Maximizing and Restoring


    (Page 3 of 4 )

    You may be familiar with the operation of this method. When you click an image, a new window appears with the maximized image. That is basically it. Our design steps are as follows:

    • Give the File Input element an onclick event.

    • When the element is clicked, a function is called that opens a new window with an image tag having the original large-sized image. There is also a title for the new window.

    The DOM statement to open a new window is:

    newWindowReference = window.open(URL,name,specs,replace);

    The parameters that the “open” function takes are all optional. In our project, we use only the “specs” parameter to give the dimensions of the new window; we have

    open('','','width=270,height=320','')

    The width is given as shown, followed by a comma and then the height. Each of the other arguments here are empty strings. For these, it is the default value that is in effect.

    When you open a window using just the above statement, the window is blank. This is because there is no HTML tag inside. You then have to write HTML tags from the parent window to the opened window. The image tag is written to the window as follows:

    imageWindow.document.write(imageTag);

    where imageTag is a string containing the image tag and all its attributes.

    Write the path to the source of the image file in full, even if the image file is in the same source as your HTML file. If you do not do this, the image may not appear in your new window.

    The following code segment prepares the title and an image tag and then writes them to the opened window.

    var titleStr = ‘<title>Full Sized Image</title>’;

    var imageTag = '<img src="Full path to image file" />';


    imageWindow=window.open('','','width=270,height=320','');

    imageWindow.document.write(titleStr);

    imageWindow.document.write(imageTag);

    Note: to have a good large-sized image, either with this method or the previous method, the image you show as the maximized image should be the original image you got from the scanner or digital camera. Any small image should be this one whose CSS dimensions have been reduced. In this way, your different-sized images will have good resolution.

    This is the JavaScript code that is called when you click a File Input element.

    <script type="text/JavaScript">


    //function to open new window with the full picture

    function openWindow(imageFile)

    {

    //form the title tag

    titleStr = "<title>Full Sized Image</title>";

     

    //form the image tag

    imageTag = '<img src="c:/For CD/March Articles 2008/Database Forms with HTML - Part X & XI/' + imageFile + '" style="border-width:0px; width:250px;height:300px" />';


    imageWindow=window.open('','','width=270,height=320','');


    imageWindow.document.write(titleStr);

    imageWindow.document.write(imageTag);

    }


    </script>

    To try the code, replace the full path I have given above with the path to the images in your computer.

    More HTML Articles
    More By Chrysanthus Forcha


       · We have done a lot. We have just this chapter and the last one. Let's get it...
     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek