It works in Netscape & Internet Explorer and works on both a PC and a Mac.
This applet allows you to display an image and the visitor to your site can zoom in/out of the image and scroll to different parts of the image.
<!-- Lawrence Goetz's Image Viewer. Copyright Lawrence Goetz 2000.
-->
<!-- Web: http://www.lawrencegoetz.com E-mail:
goetz@lawrencegoetz.com-->
<!-- Adjust the width and height of the applet here. -->
<applet code=imageviewer.class name=imageviewer width= height= >
<!-- The filename of the script goes here. -->
<param name=filename value="">
<!-- Background color goes here. -->
<param name=background value="">
<!-- Maximum zoom multiple goes here. -->
<param name=maxzoom value="">
<!-- HTML code for non Java visitors goes here. -->
You do not have Java or it is not enabled.
</applet>
Here is the explanation of the tags:
<applet code=imageviewer.class name=imageviewer width= height= >
This is the size of the applet. For example for a 450 by 300 applet it would
be
<applet code=imageviewer.class name=imageviewer width=450
height=300>
If the applet's width is less than 450, all the buttons may not be displayed.
You need to give the image's filename that will be used. It can be either
a JPG or GIF image. Enter it in here:
<param name=filename value="">
Example of an image called butterfly.jpg would be:
<param name=filename value="butterfly.jpg">
<param name=background value="">
Here you can specify the background color for the applet. The default color is gray. You can select from the following colors:
white
black
gray
light gray
dark gray
red
pink
orange
yellow
green
magenta
cyan
blue
For example to have a white background you'd do:
<param name=background value="white">
You can limit the zoom factor for the image. Too large of an image when zoomed in too far will turn black and nothing will be displayed. When that happens, you will need to zoom out untill the image is displayed again. To help prevent this from occuring, you can limit the zoom factor. The default is 16 times the original size. You can make this smaller or bigger, depending on your original image size.
For example to have 8 times zoom.
<param name=maxzoom value="8">
For visitors without Java you can have a plain image or text. Enter in any HTML code you want and place it at the end of the code here:
<!-- HTML code for non Java visitors goes here. -->
Example to tell your visitors they don't have Java would be:
<!-- HTML code for non Java visitors goes here. -->
You do not have Java or it is not enabled.
However, it would be better to have the HTML code for the image. Such as in the following example to display the butterfly image.
<!-- HTML code for non Java visitors goes here. -->
<IMG SRC="butterfly.jpg">
Place the two Java class files in the same directory that you placed your HTML file and your image in. The two class files are:
imageviewer.class
imagecanvas.class
Be sure and upload these class files when you upload your web site. Otherwise the applet will not display.
The registered key file, iview.html, is needed for the applet to in
the registered mode. Make sure you upload this file.
While viewing the applet these commands manipulate the image.
Move image - clicking and dragging the mouse will move the image around.
The buttons do the following:
Zoom In - will zoom into the image.
Zoom Out - will zoom out from the image.
Fit Window - will fit the image to the size of the applet's viewing window. This is the default view for the applet.
1 to 1 - will set the image to it's original size.
Fit Width - will fit the image to the width of the applet's viewing window.
Fit Height - will fit the image to the height of the applet's viewing window.
I have other applets and children's software on my web site. Check it out.
Questions, comments, or feedback, write to me:
Thank you,
Lawrence Goetz