FLI and FLC High-Level Functions

Fastgraph includes both high-level and low-level functions for working with flic files. The most important high-level function, fg_showflic(), plays the entire contents of a flic file any number of times. It can position the image such that its upper left corner is at the screen space origin or at the graphics cursor position in the active virtual buffer. As fg_showflic() processes each frame of the flic file, it automatically scales the frame from the virtual buffer to the client area, which causes the flic file animation to appear in the client area as it plays.

The fg_showflic() function expects three parameters. The first is the flic file name, which may include a path name, but must be null-terminated. The second specifies the number of times to play the flic file. If the play count is zero, fg_showflic() will play it continuously. The fg_showflic() function will stop playing the flic file when the Escape key is pressed. Note that this is the only way to stop playing the flic file if the play count is zero (continuous play). The third fg_showflic() parameter is a bit mask that controls how the flic file is played. The following table summarizes these flags.




If specified, play the flic file relative to the current graphics position. If not, play it relative to (0,0).


If specified, play the flic file using the current palette. If not, use the palette values stored in the flic file.


If specified, get the image data from the fg_imagebuf() buffer. If not, get the image data from the flic file.


If specified, disable color reduction and remapping. If not, enable color reduction and remapping to avoid using the Windows system colors.


If specified, play the flic file with no delay between frames. If not, delay between frames as specified in the flic header.

The fg_showflic() function returns 0 if successful, 1 if the specified file wasn't found, and 2 if the file is not a flic file.

For example, the code shown here will play the file GLASS.FLI with its upper left corner at the screen space position (16,16) in the active virtual buffer, no delay between frames, and automatic color reduction enabled:


fg_showflic("GLASS.FLI",FG_AT_XY | FG_NODELAY);


fg_showflic('GLASS.FLI'+chr(0),FG_AT_XY or FG_NODELAY);

Visual Basic:

Call fg_move(16, 16)
Call fg_showflic(App.Path & "\GLASS.FLI", FG_AT_XY + FG_NODELAY)

<< Prev

Next >>

Fastgraph Home Page


copyright 2001 Ted Gruber Software, Inc.