Jump to content

GreQueryHWPaletteInfo: Difference between revisions

From EDM2
Created page with "GreQueryHWPaletteInfo fills a buffer with the RGB value information from the hardware palette. The order of the returned values is the same as the hardware. Both RGB values an..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreQueryHWPaletteInfo fills a buffer with the RGB value information from the hardware palette. The order of the returned values is the same as the hardware. Both RGB values and the user defined xxxxx are returned. If cclr=0, only the size required for the buffer referenced by pclr is returned. The information returned can be used to create a palette. This allows a caller to create the same palette in another device context.  
GreQueryHWPaletteInfo fills a buffer with the RGB value information from the hardware palette. The order of the returned values is the same as the hardware. Both RGB values and the user defined xxxxx are returned. If cclr=0, only the size required for the buffer referenced by pclr is returned. The information returned can be used to create a palette. This allows a caller to create the same palette in another device context.


This function can be hooked by the presentation driver.
This function can be hooked by the presentation driver.


;Simulation support: This function is simulated by a handling routine in the graphics engine.  
;Simulation support: This function is simulated by a handling routine in the graphics engine.
   
   
== Syntax ==  
== Syntax ==
  GreQueryHWPaletteInfo(hdc, ulStart, cclr, pclr, pInstance, lFunction);
  GreQueryHWPaletteInfo(hdc, ulStart, cclr, pclr, pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;ulStart (ULONG) - input:Starting index, first palette entry to query.
 
;cclr (ULONG) - input:Count of palette entries.
;ulStart (ULONG) - input  
;pclr (PULONG) - input:Pointer to table of RGB2 palette entries.
:Starting index, first palette entry to query.  
;pInstance (PVOID) - input:Pointer to instance data.
 
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreQueryHWPaletteInfo.
;cclr (ULONG) - input  
:Count of palette entries.  
 
;pclr (PULONG) - input  
:Pointer to table of RGB2 palette entries.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreQueryHWPaletteInfo.  


== Returns ==
== Returns ==
;fSuccess (BOOL) - returns  
;fSuccess (BOOL) - returns:Return codes.
:Return codes.  
:This function returns BOOLEAN (fSuccess).
 
:*TRUE Successful
:This function returns BOOLEAN (fSuccess).  
:*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:
:*TRUE Successful  
:*PMERR_INV_PALETTE
:*FALSE Error  
:Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation.
 
: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_INV_PALETTE  
 
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  
 


== Sample ==
== Sample ==
Line 56: Line 38:
BOOL      fSuccess;  /*  Return codes. */
BOOL      fSuccess;  /*  Return codes. */


fSuccess = GreQueryHWPaletteInfo(hdc, ulStart,
fSuccess = GreQueryHWPaletteInfo(hdc, ulStart, cclr, pclr, pInstance, lFunction);
            cclr, pclr, pInstance, lFunction);
</pre>
</pre>


== Remarks ==
== Remarks ==
The existing color table GreQueryxxx APIs are still supported.  
The existing color table GreQueryxxx APIs are still supported.


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

Latest revision as of 00:55, 25 March 2020

GreQueryHWPaletteInfo fills a buffer with the RGB value information from the hardware palette. The order of the returned values is the same as the hardware. Both RGB values and the user defined xxxxx are returned. If cclr=0, only the size required for the buffer referenced by pclr is returned. The information returned can be used to create a palette. This allows a caller to create the same palette in another device context.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in the graphics engine.

Syntax

GreQueryHWPaletteInfo(hdc, ulStart, cclr, pclr, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
ulStart (ULONG) - input
Starting index, first palette entry to query.
cclr (ULONG) - input
Count of palette entries.
pclr (PULONG) - input
Pointer to table of RGB2 palette entries.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreQueryHWPaletteInfo.

Returns

fSuccess (BOOL) - returns
Return codes.
This function returns BOOLEAN (fSuccess).
  • 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_INV_PALETTE
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Sample

#define INCL_GRE_PALETTE
#include <os2.h>

HDC       hdc;        /*  Device context handle. */
ULONG     ulStart;    /*  Starting index, first palette entry to query. */
ULONG     cclr;       /*  Count of palette entries. */
PULONG    pclr;       /*  Pointer to table of RGB2 palette entries. */
PVOID     pInstance;  /*  Pointer to instance data. */
ULONG     lFunction;  /*  High-order WORD=flags; low-order WORD=NGreQueryHWPaletteInfo. */
BOOL      fSuccess;   /*  Return codes. */

fSuccess = GreQueryHWPaletteInfo(hdc, ulStart, cclr, pclr, pInstance, lFunction);

Remarks

The existing color table GreQueryxxx APIs are still supported.