GreRealizeColorTable
GreRealizeColorTable causes the system to ensure that, for a realizable color table, the device physical color table is set to the closest possible match to the logical color table.
This function must be supported by the presentation driver. GreRealizeColorTable is called by GpiRealizeColorTable in response to the request of an application to realize the current logical color table to device output capabilities. This function can be handled by bit-map simulation.
- Simulation support
- None. This function is mandatory for all drivers.
Syntax
GreRealizeColorTable(hdc, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreRealizeColorTable.
Returns
- 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_COL_TABLE_NOT_REALIZABLE
- PMERR_DEV_FUNC_NOT_INSTALLED
- PMERR_INV_HDC
- PMERR_INV_IN_AREA
- PMERR_INV_IN_PATH
- PMERR_REALIZE_NOT_SUPPORTED
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Sample
#define INCL_GRE_COLORTABLE #include <os2.h> HDC hdc; /* Device context handle. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreRealizeColorTable. */ BOOL rc; /* Return Code. */ rc = GreRealizeColorTable(hdc, pInstance, lFunction);
Remarks
A device context such as a hardcopy DC can implicitly realize a color table when it is created. In this case, the handling routine need only return Successful. An error must be posted if this function is called for a color table that cannot be realized.
- Note
- GreRealizeColorTable is provided for the support of older applications and is of less importance for new applications.