Difference between revisions of "GreDeviceAnimatePalette"

From EDM2
Jump to: navigation, search
(Created page with "GreDeviceAnimatePalette is the presentation driver version of GreAnimatePalette. It is called to process an application's GreAnimatePalette request. The purpose of this functi...")
 
m
 
Line 1: Line 1:
GreDeviceAnimatePalette is the presentation driver version of GreAnimatePalette. It is called to process an application's GreAnimatePalette request. The purpose of this function is to modify the RGB values in the hardware palette rapidly and make the changes apparent immediately. Changes are reflected immediately for each logical palette entry that is marked as PC-RESERVED and is associated with a hardware slot. The RGB value on the logical application's palette, as well as the hardware palette itself, are updated.  
+
GreDeviceAnimatePalette is the presentation driver version of [[GpiAnimatePalette]]. It is called to process an application's GpiAnimatePalette request. The purpose of this function is to modify the RGB values in the hardware palette rapidly and make the changes apparent immediately. Changes are reflected immediately for each logical palette entry that is marked as PC-RESERVED and is associated with a hardware slot. The RGB value on the logical application's palette, as well as the hardware palette itself, are updated.
  
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 higher) of the graphics engine.  
+
;Simulation support: This function is simulated by a handling routine in Revision 2.0 (or higher) of the graphics engine.
  
== Syntax ==  
+
==Syntax==  
  GreDeviceAnimatePalette(hdc, hdevpal, ulFormat, ulStart, cclr, pclr, pInstance, lFunction);
+
  GreDeviceAnimatePalette(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.
 +
;ulStart (ULONG) - input:Starting index, that is, the first palette entry to change.
 +
;cclr (ULONG) - input:Count of the 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=NGreDeviceAnimatePalette.
  
;hdevpal (ULONG) - input
+
==Returns==
:Device palette handle.  
+
;rc (ULONG) - returns:Return codes.
 +
:PAL-ERROR Error Count of the hardware palette slots changed.
 +
: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_PALETTE_BUSY
 +
:*PMERR_INV_IN_AREA
 +
:*PMERR_INV_IN_PATH.
  
;ulFormat (ULONG) - input
+
==Remarks==
:Specifies the entry format. Must be LCOLF_CONSECRGB.
+
This function modifies the colors in a palette. Changes are reflected immediately for each animated index that has a hardware slot.
 
+
;ulStart (ULONG) - input
+
:Starting index, that is, the first palette entry to change.
+
 
+
;cclr (ULONG) - input
+
:Count of the 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=NGreDeviceAnimatePalette.
+
 
+
== Returns ==
+
;rc (ULONG) - returns
+
:Return codes.
+
 
+
:PAL-ERROR Error Count of the hardware palette slots changed.
+
 
+
: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_PALETTE_BUSY
+
:*PMERR_INV_IN_AREA
+
:*PMERR_INV_IN_PATH.
+
 
+
 
+
== 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, the first palette entry to change. */
+
ULONG    cclr;      /*  Count of the 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=NGreDeviceAnimatePalette. */
+
ULONG    rc;        /*  Return codes. */
+
 
+
rc = GreDeviceAnimatePalette(hdc, hdevpal,
+
      ulFormat, ulStart, cclr, pclr, pInstance,
+
      lFunction);
+
 
+
 
+
</pre>
+
 
+
== Remarks ==
+
This function modifies the colors in a palette. Changes are reflected immediately for each animated index that has a hardware slot.  
+
  
 
[[Category:Gre]]
 
[[Category:Gre]]

Latest revision as of 21:23, 23 May 2020

GreDeviceAnimatePalette is the presentation driver version of GpiAnimatePalette. It is called to process an application's GpiAnimatePalette request. The purpose of this function is to modify the RGB values in the hardware palette rapidly and make the changes apparent immediately. Changes are reflected immediately for each logical palette entry that is marked as PC-RESERVED and is associated with a hardware slot. The RGB value on the logical application's palette, as well as the hardware palette itself, are updated.

This function can be hooked by the presentation driver.

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

Syntax

GreDeviceAnimatePalette(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, the first palette entry to change.
cclr (ULONG) - input
Count of the 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=NGreDeviceAnimatePalette.

Returns

rc (ULONG) - returns
Return codes.
PAL-ERROR Error Count of the hardware palette slots changed.
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_PALETTE_BUSY
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH.

Remarks

This function modifies the colors in a palette. Changes are reflected immediately for each animated index that has a hardware slot.