Example: Retrieving BitmapsThe PCXflip example demonstrates the fg_getimage() function. Its WM_CREATE handler displays a 320x200 PCX image from the file Mouse.pcx using fg_showpcx(). It calls fg_getimage() to retrieve the image as a 256-color bitmap, and then calls fg_revimage() to display the image mirrored about the y axis. PCXflip computes the size of the bitmap array with fg_imagesiz(). This function returns the number of bytes required to store a bitmapped image of specified dimensions. Its two integer parameters specify the bitmap width and height in pixels. The return value is the bitmap size in bytes. The specific bitmap type depends on the active virtual buffer's color depth:
In PCXFLIP, we use a 320x200 bitmap and a 256-color virtual buffer, so fg_imagesiz() returns a bitmap size of 64,000 bytes.
|
 
copyright 2001 Ted Gruber Software, Inc.