Image Height & Width


[Home][Index][Previous][Next]
Under normal circumstances, the AppletQuiz applet will get the image's height and width from the image itself. If the image is too large to fit into the available space, or if you just want to adjust its dimensions, you can use the HEIGHT and WIDTH tokens in the image code string to do the job.

Image Code String

Comments

{$IMG=MyImage.GIF}

The applet will load the image "MyImage.GIF" and display it at its "natural" size.

{$IMG=MyImage.GIF

The applet will display the image in a rectangle 100 pixels high and 80 pixels wide.

{$IMG=MyImage.GIF height = 100}

You don't have to specify BOTH height & width, and code strings are not case sensitive. This image will be displayed in a rectangle 100 pixels high. Its width will be its "natural" width.


For Example:

In the question file below, the question loads three images. The first image is displayed at its "natural" size. The middle image is compressed horizontally and stretched vertically. The bottom image is stretched horizontally.

\TITLE
Image Size Demo
\TF A T
This image is displayed "natural size" (70 x 43 pixels):
{$IMG="Images/Test.GIF" ALIGN=CENTER}
The image below is displayed with WIDTH=50 and HEIGHT=50:
{$IMG="Images/Test.GIF" WIDTH=50 HEIGHT=50 ALIGN=CENTER}
The image below is displayed with WIDTH=100 only:
{$IMG="Images/Test.GIF" WIDTH=100 ALIGN=CENTER}

The applet below runs this question file:

You need a Java-enabled browser to take this quiz.

[Home][Index][Previous][Next]
copyright © 1998 by Jerry L. Stanbrough - all rights reserved.
last update May 13, 1999 by JL Stanbrough (jstanbro@venus.net)