Reading Image Headers and Palettes

Fastgraph includes several functions for reading an image file's header or its palette information. Fastgraph/Image includes versions of these same functions that operate on image files stored in FGI libraries: fgi_avihead(), fgi_avipal(), fgi_bmphead(), fgi_bmppal(), fgi_flichead(), fgi_jpeghead(), fgi_pcxhead(), and fgi_pcxpal(). All of these functions expect the same parameters as their Fastgraph counterparts but have one additional parameter specifying the FGI file handle. For example, we can read a BMP file header by calling:

C/C++ and Delphi:

fg_bmphead(BMPfile,BMPheader);

Visual Basic:

Call fg_bmphead(BMPfile, BMPheader(0))

But if the BMP file is in an FGI library, you would use the analogous Fastgraph/Image function:

C/C++ and Delphi:

fgi_bmphead(BMPfile,BMPheader,hFGI);

Visual Basic:

Call fgi_bmphead(BMPfile, BMPheader(0), hFGI)

Note that there are no Fastgraph/Image versions of the Fastgraph functions that return the image dimensions (for instance, there is no fgi_bmpsize() function). This is because fg_avisize(), fg_bmpsize(), fg_flicsize(), fg_jpegsize(), fg_pcxrange(), and fg_pcxsize() all operate on an array containing an image file header, not on the files themselves. You can thus determine the dimensions of an image stored in an FGI file by first using the appropriate Fastgraph/Image "read header" function followed by the corresponding Fastgraph "return image size" function.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.