Jump to content

GreDeviceSetPaletteEntries: Difference between revisions

From EDM2
Created page with " GreDeviceSetPaletteEntries changes the entries in a palette as a result of an application's GpiSetPalette entries request. These changes do not become apparent until an appli..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
GreDeviceSetPaletteEntries changes the entries in a palette as a result of an application's [[GpiSetPaletteEntries]] request. These changes do not become apparent until an application calls [[WinRealizePalette]]. If an application wants to change its palette rapidly and makes those changes immediately apparent, it calls [[GpiAnimatePalette]].


GreDeviceSetPaletteEntries changes the entries in a palette as a result of an application's GpiSetPalette entries request. These changes do not become apparent until an application calls WinRealizePalette. If an application wants to change its palette rapidly and makes those changes immediately apparent, it calls GpiAnimatePalette.  
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 Revision 2.0 (or later) of the graphics engine.
 
;Simulation support: This function is simulated by a handling routine in Revision 2.0 (or later) of the graphics engine.  


== Syntax ==  
== Syntax ==  
  GreDeviceSetPaletteEntries(hdc, hdevpal, ulFormat, ulStart, cclr, pclr, pInstance, lFunction);
  GreDeviceSetPaletteEntries(hdc, hdevpal, ulFormat, ulStart, cclr, pclr, pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;hdevpal (ULONG) - input:Device palette handle.
 
;ulFormat (ULONG) - input:Specifies the entry format. Must be LCOLF_CONSECRGB.
;hdevpal (ULONG) - input  
;ulStart (ULONG) - input:Starting index, that is, first palette entry to change.
:Device palette handle.  
;cclr (ULONG) - input:Count of palette entries to change.
 
;pclr (PULONG) - input:Pointer to table of new RGB2 palette entries.
;ulFormat (ULONG) - input  
;pInstance (PVOID) - input:Pointer to instance data.
:Specifies the entry format. Must be LCOLF_CONSECRGB.  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreDeviceSetPaletteEntries.
 
;ulStart (ULONG) - input  
:Starting index, that is, first palette entry to change.  
 
;cclr (ULONG) - input  
:Count of palette entries to change.  
 
;pclr (PULONG) - input  
:Pointer to table of new RGB2 palette entries.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreDeviceSetPaletteEntries.  


== Returns ==
== Returns ==
;rc (BOOL) - returns  
;rc (BOOL) - returns:Return codes.
:Return codes.  
:This function returns BOOLEAN (fSuccess).
 
:*TRUE Successful, if entries set without error
: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, if entries set without error  
:*PMERR_INV_IN_AREA
:*FALSE Error  
:*PMERR_INV_IN_PATH
 
:*PMERR_INV_COLOR_INDEX
: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_IN_AREA  
:*PMERR_INV_IN_PATH  
:*PMERR_INV_COLOR_INDEX  
 
 
== Sample ==
<pre>
#define INCL_GRE_PALETTE
#include <os2.h>
 
HDC      hdc;        /*  Device context handle. */
ULONG    hdevpal;    /*  Device palette handle. */
ULONG    ulFormat;  /*  Specifies the entry format. Must be LCOLF_CONSECRGB. */
ULONG    ulStart;    /*  Starting index, that is, first palette entry to change. */
ULONG    cclr;      /*  Count of palette entries to change. */
PULONG    pclr;      /*  Pointer to table of new RGB2 palette entries. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDeviceSetPaletteEntries. */
BOOL      rc;        /*  Return codes. */
 
rc = GreDeviceSetPaletteEntries(hdc, hdevpal,
      ulFormat, ulStart, cclr, pclr, pInstance,
      lFunction);
</pre>


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

Latest revision as of 20:20, 14 April 2020

GreDeviceSetPaletteEntries changes the entries in a palette as a result of an application's GpiSetPaletteEntries request. These changes do not become apparent until an application calls WinRealizePalette. If an application wants to change its palette rapidly and makes those changes immediately apparent, it calls GpiAnimatePalette.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in Revision 2.0 (or later) of the graphics engine.

Syntax

GreDeviceSetPaletteEntries(hdc, hdevpal, ulFormat, ulStart, cclr, pclr, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
hdevpal (ULONG) - input
Device palette handle.
ulFormat (ULONG) - input
Specifies the entry format. Must be LCOLF_CONSECRGB.
ulStart (ULONG) - input
Starting index, that is, first palette entry to change.
cclr (ULONG) - input
Count of palette entries to change.
pclr (PULONG) - input
Pointer to table of new RGB2 palette entries.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceSetPaletteEntries.

Returns

rc (BOOL) - returns
Return codes.
This function returns BOOLEAN (fSuccess).
  • TRUE Successful, if entries set without 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_INV_IN_AREA
  • PMERR_INV_IN_PATH
  • PMERR_INV_COLOR_INDEX