W$BITMAP

This routine is a collection of related operations that handle bitmapped (BMP, JPEG, PNG, and TIFF) images. Only Windows machines can actually display bitmaps. On all other machines, this routine returns an error code.

Usage

CALL "W$BITMAP"
    USING OP-CODE, parameters,
    GIVING BITMAP-HANDLE

Parameters

OP-CODE Numeric parameter Selects the W$BITMAP operation to perform. The file acugui.def contains level 78 symbolic names for these operations. Unless otherwise noted, these operations can be used in a thin client environment. The specific operations are described below.
parameters Vary depending on the op-code chosen.
BITMAP-HANDLE PIC S9(9) COMP-4 (or COMP-5) BITMAP-HANDLE holds the return value of W$BITMAP. Values less than or equal to zero indicate errors. If you are loading or destroying ImageLists, this should be a COMP-5 field.

Description

W$BITMAP can be used to display a bitmapped image, load a bitmapped image into memory, or remove a bitmapped image and free its memory. You can use this routine to load a bitmapped image into memory as a Windows API data type called an ImageList, which treats the bitmap file as a series of fixed-width images. This provides a simplified way to load and destroy ImageLists when using the thin client. This routine can be used to capture screen shots of an active window or desktop. This routine can also be used to load IPictureDisp objects.

When it is trying to locate a bitmap file, W$BITMAP will search first for a resource with the specified name, and then for a disk file. Resources are named in a fashion similar to disk files, but without any directory information. (See the COPY RESOURCE statement in ACUCOBOL-GT Reference Manual for more information about including resources.)

Note: When you are running in a thin client environment, and a file name beginning with @[DISPLAY] is passed to this routine, it will attempt to access the file in the display host's file system. It does not download the file from the server. For more information, refer to the topic Using Library Routines and DLLs in Thin Client, in the AcuConnect User's Guide.

W$BITMAP will examine files to determine the type of image format. If the file suffix is .jpg, .jpe or .jpeg, W$BITMAP assumes the file is a JPEG image; if the file suffix is .png, it assumes the files are in PNG format; if the file suffix is .tiff, .tff or .tif, it assumes the files are in TIFF format; otherwise, it assumes the files are in BMP format. In order to read JPG files, you must have the file ajpg32.dll or ajpg64.dll installed in the appropriate runtime directory.

W$BITMAP loads 24-bit color or 8-bit grayscale images in jpeg, png, or tiff formats. It reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPG lossless mode format is not supported.

Note: The behavior of this library routine is affected by the setting of the FILENAME_SPACES configuration variable that may or may not allow spaces in a file name. See the documentation on FILENAME_SPACES in Appendix H.