| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (11 out of 12)

Using a Graphic as a Background Image

You can specify that a workspace display a graphics image as its background. To reference the image, enter the name of an image-definition in the Background-images attribute for the workspace. For more information about image definitions, see Chapter 30, External Images.

The image definition must refer to a file that contains the bitmap graphics data. The image definition bitmap itself can be up to 65,536 by 65,536 pixels in size.

For example, to include the image referenced in the image definition named world-map, enter the following statement in the Background-images attribute:

In this statement, the x and y coordinates direct G2 to place the center of the image 10 workspace units above and 10 workspace units to the right of the workspace origin.

Various GIFs that can be used as workspace background images are available in the G2 demos directory, as described under GIF Files.

Specifying the Center of the Background Image

The x, y coordinates in the Background-images attribute identify where G2 places the center of the image. G2 positions the center of the image with respect to the center of the workspace's extent; it does not position the image with respect to the workspace origin.

If you do not specify x, y coordinates in the Background-images attribute:

For example, the next figure shows two versions of a workspace that contains six items: before and after including a background image.


The three objects on the right half of each workspace display their respective item-x-positions and item-y-positions in attribute displays. The attribute displays indicate that the workspace origin is not within its extent.

After entering the name of an image definition in the workspace Background-images attribute, with no x, y coordinates included, G2 changes this workspace by automatically:

Displaying More Than One Background Image

You can display more than one image in the background of a workspace. To do this, enter a statement in the Background-images attribute, such as:


Note: If you specify more than one image definition in the Background-images attribute, and if the extents of the images overlap, G2 displays image definitions at the end of the list on top of those at the beginning of the list.

Saving the Background Image in the KB

You can save the graphics data that comprise the background image in a saved KB file. To do so, specify yes as the value of the Save-image-data-with-kb attribute of the image definition referenced in the Background-images attribute. Doing so prevents you from inadvertently separating the image data from your KB when you move the KB to another system, but doing so also increases the size of your KB file when next saved.

Other Considerations for Using Background Images

As you work with background images for your workspaces, keep these considerations in mind:

Be aware that G2 reads the bitmap graphics file referenced in an image definition for a background image in only three situations:

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (11 out of 12)

Copyright © 1997 Gensym Corporation, Inc.