Feel free to use this on your own web page. Please let me know if you do use it.
Note, this is free and just for fun... There are no guarantees or warranties or anything like that... in other words, don't sue me.
Netscape 3 only works with 32x32 XBM images... no larger, no smaller. Anything else will look like gibberish. It also won't clear the image properly if you set the src to a new image.
Download the file xbmDraw.js and include it on your web page with
Then, from script create a new image with:
var myxbm = new XBMImage(width,height,name);
You can then manipulate the new object with the following methods:
There are a few other methods and properties, but they're meant for internal use.
- draw a dot
- clear the entire image
- draw a line between two points
- draw a circle with the given radius and center.
- draw a circle that fits within the box specified by the two points.
- draw a box with the given corner locations.
- draw a filled box.
- store a copy of the current image at the given "frame" index.
- showFrame(index) - set the current image to the copy stored at the given "frame" index.
- load an existing XBM image (doesn't currently parse the width/height, just the data).
- get the XBM string for the current image.
Once you have created your XBM, you can use it on a web page with an IMG tag like the following:
The image can later be changed to another "frame" with e.g.:
Even if that was the original src value.
Last Modified: April 14, 2002