## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### GreGetScreenBits - Parameters

hdc (HDC) - input Any valid, direct (screen) device context handle.

hrgnApp (HRGN) - input Area of the screen to be acquired.

Area can be either a valid region handle or a pointer to an inclusive RECTL , specified by a flag in the flCmd field.

pDest (PBYTE) - input Pointer to the memory buffer where the compressed data will be written.

pulLength (PULONG) - input Pointer to a ULONG.

The ULONG must contain the length of the memory buffer pointed to by pDest. Valid values range from 2071 bytes to 64K bytes. Upon exit, the ULONG contains the number of bytes stored in the memory buffer.

flCmd (ULONG) - input Option flags.

These flags specify the format (bits per pel, linear or planar) of the data to be put in the memory buffer. flCmd also indicates whether hrgn contains a region handle or a pointer to a RECTL. Valid options include the following:

GSB_OPT_4BPP 0000H

GSB_OPT_8BPP 0001H

GSB_OPT_16BPP 0002H

GSB_OPT_LINEAR 0000H

GSB_OPT_PLANAR 0008H

GSB_OPT_HRGN 0010H

These option flags are ORed together to create the flCmd field.

pdcArg (PDC) - input Pointer to instance data.

FunN (ULONG) - input High-order word=Flags; Low-order word= NGreGetScreenBits.

rc (LONG) - returns This function returns one of the following:

1 The entire area was successfully compressed in the memory buffer. Upon exit, the supplied region or rectangle will be NULL.

2 A subset of the area was saved in the memory buffer because the buffer was not big enough for the whole area. Upon exit, the supplied region or rectangle will be updated to contain the area that was NOT compressed. This implies that GreGetScreenBits will have to be called again to complete the area compression.

0 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_INV_DC_TYPE
PMERR_INV_FORMAT_CONTROL
PMERR_INV_IMAGE_DIMENSION
PMERR_INV_IN_AREA
PMERR_INV_IN_PATH
PMERR_INV_LENGTH_OR_COUNT
PMERR_PEL_NOT_AVAILABLE

Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.