Jump to content

GreDeviceResizePalette: Difference between revisions

From EDM2
Created page with "GreDeviceResizePalette changes the size of a logical palette. If the size is reduced, the removed entries are deleted. If the size is increased, the new entries are set to Bla..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreDeviceResizePalette changes the size of a logical palette. If the size is reduced, the removed entries are deleted. If the size is increased, the new entries are set to Black.  
GreDeviceResizePalette changes the size of a logical palette. If the size is reduced, the removed entries are deleted. If the size is increased, the new entries are set to Black.


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 ==  
  GreDeviceResizePalette(hdc, hdevpal, ulSize, pInstance, lFunction);
  GreDeviceResizePalette(hdc, hdevpal, ulSize, pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;hdevpal (ULONG) - input:Device palette handle.
 
;ulSize (ULONG) - input:New palette size.
;hdevpal (ULONG) - input  
;pInstance (PVOID) - input:Pointer to instance data.
:Device palette handle.  
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreDeviceResizePalette.
 
;ulSize (ULONG) - input  
:New palette size.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreDeviceResizePalette.  


== Returns ==
== Returns ==
;rc (LONG) - returns  
;rc (LONG) - returns:Return codes.
:Return codes.  
:On completion, this function returns the following values:
 
:*Error (0)
:On completion, this function returns the following values:  
:*Successful (1)
 
:*Error (0)  
:*Successful (1)  


== Sample ==
== Sample ==
<pre>
<pre>
#define INCL_GRE_PALETTE
#define INCL_GRE_PALETTE
#include <os2.h>
#include <os2.h>
Line 46: Line 33:
LONG    rc;        /*  Return codes. */
LONG    rc;        /*  Return codes. */


rc = GreDeviceResizePalette(hdc, hdevpal,
rc = GreDeviceResizePalette(hdc, hdevpal, ulSize, pInstance, lFunction);
      ulSize, pInstance, lFunction);
</pre>
</pre>


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

Latest revision as of 00:08, 24 March 2020

GreDeviceResizePalette changes the size of a logical palette. If the size is reduced, the removed entries are deleted. If the size is increased, the new entries are set to Black.

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

GreDeviceResizePalette(hdc, hdevpal, ulSize, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
hdevpal (ULONG) - input
Device palette handle.
ulSize (ULONG) - input
New palette size.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreDeviceResizePalette.

Returns

rc (LONG) - returns
Return codes.
On completion, this function returns the following values:
  • Error (0)
  • Successful (1)

Sample

#define INCL_GRE_PALETTE
#include <os2.h>

HDC      hdc;        /*  Device context handle. */
ULONG    hdevpal;    /*  Device palette handle. */
ULONG    ulSize;     /*  New palette size. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreDeviceResizePalette. */
LONG     rc;         /*  Return codes. */

rc = GreDeviceResizePalette(hdc, hdevpal, ulSize, pInstance, lFunction);