## Presentation Device Driver Reference for OS/2

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

### GreSetScreenBits - Syntax

Simulation support:

This function is mandatory for display drivers that want to be DCAF-enabled .

Description GreSetScreenBits takes compressed data, generated by a previous call to GreGetScreenBits, from a buffer and decompresses it into the currently selected memory bit map. The call is only valid for a memory DC that has a bit map selected that is the same size as the screen of the machine on which the GreGetScreenBits call was performed. There is no clipping; if a rectangle exceeds the bit-map dimensions, the function will terminate immediately with an error logged. The bit map may be left in a partially drawn state as prior rectangles may have been copied into it.

This is a drawing primitive; therefore, correlation, boundary accumulation and drawing could take place. Function bits are ignored, however, and only drawing will be done.

The function may be passed a region handle, in which case the area defined by the set bits will be added to the region.

The DCAF-enabled driver may be passed 4bpp planar, 4bpp packed, 8bpp packed and 16bpp packed data.

    #define INCL_GRE_SCREEN

    #include <os2.h>

    #include <pmddi.h>

    HDC      hdc;      /*  Any valid, direct (screen) device context handle. */

    PBYTE    pBuffer;  /*  Pointer to source (compressed) data. */

    ULONG    cBytes;   /*  Length of the memory buffer pointed to by pBuffer. */

    HRGN     hrgn;     /*  A valid region handle. */

    PDC      pdcArg;   /*  Pointer to instance data.  */

    ULONG    FunN;     /*  High-order word=Flags; Low-order word=NGreSetScreenBits. */

    LONG     rc;

    rc = GreSetScreenBits(hdc, pBuffer, cBytes,

           hrgn, pdcArg, FunN);