Example: Direct Color Bitmaps

The Dcb program uses the direct color bitmap display functions in a high color virtual buffer and is very similar to the previous Bitmap program. Dcb defines a 40x20 bitmapped image of a bird in flight; it stores this bitmap in the Bird array. It displays the bird bitmap with each bitmap display function described in the previous section. To demonstrate clipping, fg_clipdcb() displays the bird entering the left edge of the window, and fg_flipdcb() does so from the right edge. Note that all the direct color bitmap display functions except fg_putdcb() treat zero-value pixels as transparent, so we use 0 for the bitmap's transparent pixels and 0821 hex for its black pixels (0821 hex is the 5/6/5 encoded RGB value with each color component's low order bit set). The fg_putdcb() function displays zero-value pixels as black pixels, producing a black rectangle around the bird.

C/C++ version

C++Builder version

Delphi version

Visual Basic version

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.