fgi_showpcx() (Fastgraph/Image)

Win32 DirectX Fastgraph/Light

Prototype

int fgi_showpcx (char *filename, int flags, int handle);

Function fgi_showpcx (ByVal filename As String, ByVal flags As Long, ByVal handle As Long) As Long

function fgi_showpcx (filename : string; flags, handle : integer) : integer;

Description

The fgi_showpcx() function displays a PCX file stored in an FGI library.

256-color PCX files are reduced to the 236 non-system colors if color reduction is enabled. 16-color and monochrome PCX files are always remapped to colors 10 to 25 to avoid conflicts with the system colors.

Parameters

filename is the name of the PCX file. It may only include a file name and extension (such as PICTURE.PCX) and must be terminated by a null character (that is, a zero byte).

flags is a series of flags that controls how the image is displayed:

Flag

Meaning

FG_AT_XY

If specified, display the image relative to the current graphics position. If not, display the image at the position indicated in PCX header.

FG_IGNOREPALETTE

If specified, display the image using the current palette. If not, use the palette values stored in the PCX file. Not meaningful for 24-bit PCX files.

FG_KEEPCOLORS

If specified, disable color reduction and remapping. If not, enable color reduction and remapping to avoid using the Windows system colors. Not meaningful for 24-bit PCX files.

handle is the file handle for the FGI library containing filename.

Return value

0 = Success

-1 = Error reading the FGI library

-2 = The requested file is not in the FGI library

-3 = The requested file is not a PCX file

-4 = The PCX file cannot be loaded into the active virtual buffer

-5 = Error allocating memory

Restrictions

A logical palette must be defined and realized in order to use the palette values stored in the PCX file.

24-bit PCX files can only be loaded into direct color virtual buffers.

See also

fgi_display(), fg_makepcx(), fgi_pcxhead(), fgi_pcxpal(), fg_pcxrange(), fg_pcxsize(), fg_realize()

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.