FFBmpServices
bitmap file management

Prototype

Put the following prototype in the prototypes section of the application program header file:

int ( __stdcall *pfnFFBmpServices )( int, HANDLE, void* );

Purpose

Load in memory a 256 colours uncompressed bitmap, togheter with its colour lookup table ("palette").

Description and use

This function offers five services numbered from 1 to 5. The services are:
  • service 1 - check the file is a 256 colours bitmap
  • service 2 - get image width in pixels
  • service 3 - get image length in lines
  • service 4 - get the pointer to the colour palette associated with the image
  • service 5 - load the bitmap into the memory
When reading a file please call services 1, 2, 3, 4 and 5 seaquentially in ascending order.

Don't forget to allocate as much memory as requested to accomodate the whole image (the size in bytes of the memory area should be the product of the image width by the image height).

The application program is in charge to open and close the bitmap file, using the standard Win32 APIs CreateFile and CloseHandle.

Specification

None.

Parameters

  • first parameter: number of the requested service (from 1 to 5)
  • second parameter: handle to the bitmap file
  • third parameter - the meaning of the 3rd parameter varies according to the requested service:
    • service 1: NULL
    • service 2: NULL
    • service 3: NULL
    • service 4: NULL
    • service 5: pointer to the allocated memory

Return value

If the return value is 0 an error occurred. If the return value is not zero its meaning depends on the service that has been requested:
  • service 1: 1=the file is a good bitmap; 2=the file is not a good bitmap
  • service 2: image width in pixels
  • service 3: image length in lines
  • service 4: pointer to the colour palette
  • service 5: 1=the image has been correctly loaded

Application examples

See also
  • FFView: 256 colours *full screen* bitmap display with pan, zoom, rotation, etc.

Notes