How to Change Maps/Photos

by Suzanne Alejandre

As you create a customized version of any of the lessons displayed on the Index page that use the Image_and_Cursor applet, you may wish to replace the map or photo that we have with one of your choosing.

There are several methods to use to get another map or photo including:

So, let's assume that you have the image that you want to use with the applet. We'll call your map or photo image.gif. It can be either a gif or a jpg. Both graphics formats will work. Just remember to use the same name in your code as you named your file.

Also you need to know the size of your image. This will make a difference when you change it for another one. You can approach this using two methods. One, you can just estimate and hope that it works. Two, you can use a program like Adobe PhotoShop to find the "image size" and know exactly what size your image is. It probably will depend what software and tools you have available. Remember, though, if this changing process doesn't work, it might be because your image isn't the right size and you have some adjusting to do.

Here's what you'll do to get your new image in place.

  1. Make a copy of one of the applet.html pages. For an example, I'll use this one:
  2. Put it on your computer (or server) in the same directory where you have these files:
  3. Open the file: lesson5.applet.html and find this part of the code:
            <param name = "backdrop_filename" value = "rialto.gif">
  4. Change the "rialto.gif" for "image.gif" or whatever name you've chosen for your image.
  5. Now we have to think about the size. This is the important code that controls the size:
    <APPLET archive="Image_and_Cursor.jar" code="Image_and_Cursor" width = 650 height = 458>
    <param name = "applet_width" value = "650">
    <param name = "applet_height" value = "458">
    <param name = "image_width" value = "422">
    <param name = "image_height" value = "359">
  6. The "rialto.gif" image is 422 (width) by 359 (height) and so you can see that those were the numbers that I used for the image_width and the image_height. The other two sets of numbers are larger because they're defining the space the applet takes up and when you have the controls on the side those numbers have to be large enough to accomodate those along with the image.

Once you've tried all of that, test it! Open the applet file and see if your image loads. If it doesn't work remember to check:

  • Do you have all of the files (applet.html, jar file, and image file) all in the same directory?
  • Did you change the gif or jpg name correctly?
  • Did you account for a difference in size?

[Privacy Policy] [Terms of Use]

Home || The Math Library || Quick Reference || Search || Help 

© 1994- The Math Forum at NCTM. All rights reserved.
Send comments to: Suzanne Alejandre