Jump to content

GreSaveScreenBits

From EDM2
Revision as of 23:28, 23 March 2020 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GreSaveScreenBits saves a rectangle of screen bits.

Simulation support
This function is mandatory for display drivers. For other drivers, it is simulated by a handling routine in the graphics engine.

Syntax

GreSaveScreenBits(hdc, prclRect, pInstance, lFunction)

Parameters

hdc (HDC) - input
The device context handle.
prclRect (PRECTL) - input
A pointer to a screen rectangle defined in screen coordinates.
pInstance (PVOID) - input
A pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreRestoreScreenBits.

Return Code

rc (ULONG) - returns
Return codes.
On completion, the handling routine must return a handle to the saved bits (hsbBits) or 0 to indicate that the bits were not saved or that an error occurred.
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_INV_HDC

Remarks

It is permissible to implement this function by returning 0 to indicate that the bits were not saved and, therefore, must be saved by the calling routine.

This function lets the user-interface routines improve the performance of dialog boxes.

Sample Code

#define INCL_GRE_BITMAPS
#include <os2.h>

HDC       hdc;        /*  The device context handle. */
PRECTL    prclRect;   /*  A pointer to a screen rectangle defined in screen coordinates. */
PVOID     pInstance;  /*  A pointer to instance data. */
ULONG     lFunction;  /*  High-order WORD=flags; low-order WORD=NGreRestoreScreenBits. */
ULONG     rc;         /*  Return codes. */

rc = GreSaveScreenBits(hdc, prclRect, pInstance, lFunction);