GreQueryDeviceBitmaps
Appearance
GreQueryDeviceBitmaps stores a list of bit-map formats supported by the device in the array addressed by paOutData. The number of formats supported can be found by using GreQueryDeviceCaps.
This function must be supported by the presentation driver. GreQueryDeviceBitmaps is called by GpiQueryDeviceBitmapFormats in response to the request of an application for a list of the bit-map formats that the device context supports. This function can be handled by bit-map simulation.
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreQueryDeviceBitmaps(hdc, paOutData, cOutData, pInstance, lFunction);
Parameters
- hdc (HDC) - input
- Device context handle.
- paOutData (PLONG) - input
- Pointer to array where the bit-map format data is returned.
- Excess elements are set to 0.
- cOutData (LONG) - input
- Number of elements in the array pointed to by paOutData.
- This number must be even.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreQueryDeviceBitmaps.
Return Code
- rc (BOOL) - returns
- Return Code.
- On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
- TRUE Successful
- FALSE Error
- Possible Errors Detected: When an error is detected, the handling routine must call WinSetErrorInfo to post the condition. Error codes for conditions that the handling routine is expected to check include:
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_INV_LENGTH_OR_COUNT
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Remarks
Each bit-map format is returned in a pair of array elements and is in the form (cPlanes, cBitsPerPel). The first pair in the array must be the format that most closely matches the device.
Sample Code
#define INCL_GRE_DEVICE #include <os2.h> HDC hdc; /* Device context handle. */ PLONG paOutData; /* Pointer to array where the bit-map format data is returned. */ LONG cOutData; /* Number of elements in the array pointed to by paOutData. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreQueryDeviceBitmaps. */ BOOL rc; /* Return Code. */ rc = GreQueryDeviceBitmaps(hdc, paOutData, cOutData, pInstance, lFunction);