Tip -- Creating An Empty Image

This tip demonstrates a unique way of creating an empty image to be used with an Image Bar Widget using a drawing tool like Jasc Paint Shop Pro 6 or 7.

Image Bar Widget Refresher
If you are already familiar with the Image Bar Widget, then you know that you can use two images of your own to create a custom " bargraph" . A byte (or word) returned from a function call is the input. Based upon the value of the byte (or word) returned, a % of the empty image and a % of the full image are displayed. The syntax for specifying empty and full images is as follows:

< PARAM NAME=" empty" VALUE=" image1" >
< PARAM NAME=" full" VALUE=" image2" >

where:
" image1" specifies the image used when the minimum value is returned from the HREF function, and " image2" specifies the image used when the maximum value is returned from the HREF function.

The Example
The following example will walk you through the steps of taking an existing full image and creating an empty image version to use in an Image Bar Widget. Figure 1 shows a snapshot of the full image that will be used in the example.


Figure 1.

Step 1
Launch the Jasc Paint Shop software and load the full image by clicking on File -> Open and selecting the appropriate file.

Step 2
The first thing to do after the full image is loaded is to maximize the color depth in order to get maximum arithmetic capabilities exercised on the image during the conversion process. From the menu bar, click on Colors -> Increase Color Depth -> 16 Million Colors (24-bit).

Step 3
Now its time to apply the effect which will convert the existing full image to an empty version of the image. From the menu bar, click on Effects -> Edge -> Trace Contour. Figure 2 shows what the image from Figure 1 would look like after performing this step.


Figure 2.

Step 4
Since the Amulet uHTML Compiler does not currently support color images, the empty image must first be converted back to a monochrome format. To convert the empty image to monochrome, from the menu bar click on Colors -> Decrease Color Depth -> 2 Colors (1-bit) -- Grey values, Nearest color, Weighted.

Step 5
The final step is to save the empty image. Be sure NOT to overwrite the existing full image when saving the modified version. Save the empty image by clicking on File -> Save As.

Amulet Tip Archive
Amulet Tips


© 2003-2005 Amulet Technologies. U.S. and Foreign Patents Pending.
µ HTML is a Trademark of Amulet Technologies