Image-Specific Display Functions

The fgi_display() function includes support for many different image file formats. While this provides a simple, consistent way to display images from FGI libraries, it can be wasteful because most FGI libraries won't contain all types of image files. For example, suppose you have an FGI library containing only PCX files. The fgi_display() function also would include the code and global data for displaying BMP, JPEG, FLI/FLC, AVI, and pixel run images. Hence a program that uses fgi_display() will require more memory to support unused image file types.

Fastgraph/Image also provides image-specific display functions: fgi_showavi(), fgi_showbmp(), fgi_showflic(), fgi_showjpeg(), and fgi_showpcx(). These functions are analogous to their Fastgraph counterparts, but they display the image from an FGI file. Each requires one additional parameter specifying the FGI file handle, and the file name parameter of course references a file in an FGI library instead of an actual file. The return values vary for each function; consult the Fastgraph/Image 6.0 Reference Manual for details. Like fgi_display(), the image-specific display functions also use the fg_imagebuf() buffer.

In example FGIW1 we used fgi_display() to display a PCX image from the EXAMPLE.FGI library. We could have instead used fgi_showpcx() to do this:

C/C++:

fgi_showpcx("CLOUDS.PCX",FG_AT_XY,hFGI);

Delphi:

fgi_showpcx('CLOUDS.PCX'+chr(0),FG_AT_XY,hFGI);

Visual Basic:

Call fgi_showpcx("CLOUDS.PCX", FG_AT_XY, hFGI)

The resulting EXE file would then be smaller and use less memory because it does not include code and data for displaying BMP, JPEG, flic, AVI, and pixel run files.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.