Example: Monochrome Bitmaps

The Monomap program illustrates Fastgraph's monochrome bitmap display functions. Monomap displays the string "Hello" as bitmapped text. Each character is 8x8 pixels, so the required bitmap size is 40x8 pixels, or 5x8 bytes. The program is conceptually similar to the Bitmap program and has a top-level menu with selections for each Fastgraph monochrome bitmap display function. For example, selecting "Drawmap" calls fg_drawmap() to display the bitmapped text in the middle of the client area, as shown here:

The processing for each menu item is very similar: fill the virtual buffer with white pixels (which erases any previously drawn bitmap), move to the desired position, display the bitmap, and copy the virtual buffer contents to the window's client area. The Drawmap handler displays the bitmapped text in black (color 10) in the middle of the virtual buffer. To demonstrate clipping, the Clipmap handler displays the bitmapped text in red (color 22) partially beyond the left edge of the virtual buffer. The entire "H" and the left half of the "e" are clipped.

C/C++ version

C++Builder version

Delphi version

Visual Basic version

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.