Commands for Including Pictures

To insert a bitmap into a topic, you include a command in your topic file that tells Viewer the name of the bitmap file and how to align it. Positioning the bitmap in a topic requires two steps:

Entering a command in the topic file at the location where you want the bitmap

Making an entry in the project (.MVP) file and providing the bitmap's location

Putting a Bitmap into a Topic File

To include a bitmap, type one of the following bitmap-reference commands in the Word topic file:


{bmcwd bitmapfile}


{bmlwd bitmapfile}


{bmrwd bitmapfile}

The following sections contain examples for each of the bitmap reference commands and show the entries necessary to make them work.

In each pair of commands, the commands with and without wd at the end display bitmaps in exactly the same way. The commands ending with wd store the bitmap data differently in the title. This difference is explained in “Storing Bitmap Data,” later in this chapter.

Using bmc and bmcwd (Bitmap Character)

Viewer treats a bmc or bmcwd bitmap as another character and places it at that position in the line. When you use the bmc or bmcwd command, text doesn't wrap automatically around the image. Instead, text follows the bitmap, positioned at the base of the bitmap.

Summary: In the Topic File

The sample application uses bmc references for bitmaps in Information screens. For example, bmc references in the “Information” topic for the state of Arizona are coded as follows:





The following illustration shows how the coding appears in the Word topic file:

Note :

Don't specify negative line spacing for a paragraph that has a bmc or bmcwd bitmap reference. If you do, the bitmap might appear on top of the paragraph when Viewer displays the topic.

Once you have the reference bitmaps positioned, compile the topic file to see how they appear. Chapter 5, “Building the Title,” explains how to compile a title.

Summary: How It Displays

After you compile your topic file, Viewer displays the five referenced bitmaps, as shown in the following illustration:

Positioning Bitmaps Using bml (Bitmap Left)

The compiler places a bml or bmlwd bitmap along the left margin, with text wrapping automatically along the right edge of the image.

Summary: In the Topic File

The sample application uses the bml reference for bitmaps used in topic headings and for illustrations in some “Nickname” popup windows.

For example, the State Bird topic for Washington is coded as follows:

 Bird of the family Fringillidea,...

The following illustration shows how this topic appears in the Word topic file:

Summary: How It Displays the Bitmap

After you compile the topic file, Viewer displays the referenced bitmap, as shown in the following illustration:

Summary: Positioning the bml Reference

The bml or bmlwd references should be placed at the beginning of a paragraph. This ensures proper wrapping of text around the right edge of the bitmap. When you compile your topic file, the bitmap will appear to the left of the text, as shown in the previous illustration.

When you put a bml reference at the end of a paragraph, the text wraps to the paragraph end before displaying the bitmap. When you compile the file, the bitmap will appear under the text and to the left, as shown in the following illustration:

Positioning Bitmaps Using bmr (Bitmap Right)

The compiler places a bmr or bmrwd bitmap at the right margin, with text to its left.

Summary: In the Topic File

The sample application uses the bmr reference for some bitmaps in the Land and People, Economy, Government, and History topics—positioning bitmaps on the right and text on the left. As an example, the History topic for Massachusetts uses the bmr reference for its bitmap. The sample code appears as follows:

The Pilgrims landed in 1620...

The following illustration shows how this topic appears in the Word topic file:

Summary: How It Displays the Bitmap

After you compile the topic file, Viewer displays the referenced bitmap as follows:

Summary: Positioning the bmr Reference

The bmr reference is placed at the beginning of a paragraph. This ensures proper wrapping of text around the left edge of your bitmap. When you compile the file, the bitmap will appear to the right of the text, as shown in the previous illustration.

When you put a bmr reference at the end of a paragraph, the text wraps to the paragraph end before displaying the bitmap. When you compile the file, the bitmap will appear under the text and to the right, as shown in the following illustration:

Storing Bitmap Data

The bmc, bml, and bmr commands all have alternative forms ending with wd. Bitmaps positioned using the bmcwd, bmlwd, and bmrwd commands look the same as bitmaps positioned using the bmc, bml, and bmr commands. However, the commands ending in wd store the bitmap data differently.

When you use the bmc, bml, or bmr command, the bitmap data is stored separately from the title text. A single copy of the bitmap is used for all bmc, bml, or bmr commands that display the same bitmap. Thus, using these commands can reduce the size of your title somewhat, although the amount of space you save is usually small compared to the size of your title. The main disadvantage to using these commands is that Viewer displays bitmaps more slowly than it does when you use the wd commands. Although this difference is not noticeable when running Viewer on a hard disk, it can be noticeable when running from a CD-ROM.

When you use the bmcwd, bmlwd, and bmrwd commands, the bitmap data is stored in-line with your title text. This means that the bitmap data actually becomes part of the title (.MVB) file, and this data appears in the location given by the command. For example, if your topic file looks like the following example:

text text text text text

The data in the .MVB file actually looks like the following example:

bitmap text text text text text

When the bitmap is stored in-line with the text, Viewer can display it faster than if it were positioned using the bmc, bml, or bmr commands.

The primary limitation of using in-line commands is that you can't use them for bitmaps larger than 64K. (You can crop or compress the bitmap to 64K in most cases.) Also, because each bmcwd, bmlwd, or bmrwd command stores a separate copy of the bitmap, your title is slightly larger than it would be if you used the non-wd commands.

Summary: Guidelines

Use the following guidelines to decide whether to use the normal or in-line versions of these commands:

Use bmc, bml, and bmr for bitmaps that appear frequently in your title.

Use bmc, bml, and bmr for bitmaps that appear in two or more topics normally displayed in sequence (for example, in a browse sequence).

Use bmcwd, bmlwd, and bmrwd for bitmaps that appear only once or infrequently in your title.