Jump to content

GreRealizeColorTable: Difference between revisions

From EDM2
Created page with "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 ..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
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.  
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.  
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.
;Simulation support: None. This function is mandatory for all drivers.


== Syntax ==  
== Syntax ==  
  GreRealizeColorTable(hdc, pInstance, lFunction);
  GreRealizeColorTable(hdc, pInstance, lFunction)


== Parameters ==
== Parameters ==
; hdc (HDC) - input : Device context handle.  
;hdc (HDC) - input : Device context handle.
 
;pInstance (PVOID) - input : Pointer to instance data.
; pInstance (PVOID) - input : Pointer to instance data.  
;lFunction (ULONG) - input : High-order WORD=flags; low-order WORD=NGreRealizeColorTable.
 
; lFunction (ULONG) - input : High-order WORD=flags; low-order WORD=NGreRealizeColorTable.  
 


== Returns ==
== Returns ==
; rc (BOOL) - returns : Return Code.  
;rc (BOOL) - returns : Return Code.
 
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.
On completion, the handling routine must return a BOOLEAN value to indicate success or an error.  
*TRUE Successful
*TRUE Successful  
*FALSE Error
*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
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_COL_TABLE_NOT_REALIZABLE  
*PMERR_INV_HDC
*PMERR_DEV_FUNC_NOT_INSTALLED  
*PMERR_INV_IN_AREA
*PMERR_INV_HDC  
*PMERR_INV_IN_PATH
*PMERR_INV_IN_AREA  
*PMERR_REALIZE_NOT_SUPPORTED
*PMERR_INV_IN_PATH  
Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
*PMERR_REALIZE_NOT_SUPPORTED  
 
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  


== Sample ==
== Sample ==
Line 43: Line 37:
BOOL    rc;        /*  Return Code. */
BOOL    rc;        /*  Return Code. */


rc = GreRealizeColorTable(hdc, pInstance,
rc = GreRealizeColorTable(hdc, pInstance, lFunction);
      lFunction);
 
</pre>
</pre>


== Remarks ==
== 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.  
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.  
;Note: GreRealizeColorTable is provided for the support of older applications and is of less importance for new applications.


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 01:16, 25 March 2020

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.