Jump to content

GrePaintRegion

From EDM2
Revision as of 17:33, 7 February 2020 by Martini (talk | contribs) (Created page with "GrePaintRegion paints the specified region by using the current area foreground and background colors. This function can be hooked by the presentation driver. ;Simulation ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GrePaintRegion paints the specified region by using the current area foreground and background colors.

This function can be hooked by the presentation driver.

Simulation support
This function is simulated by a handling routine in the graphics engine.

Syntax

GrePaintRegion(hdc, hrgn, pInstance, lFunction);

Parameters

hdc (HDC) - input
Device context handle.
hrgn (HRGN) - input
Region handle.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGrePaintRegion.

Return Code

rc (LONG) - returns
Return codes.
This function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected:
  • GPI_OK Successful
  • GPI_HITS Successful with correlate hit (returned by display drivers when the correlate flag is ON, and a hit is detected)
  • GPI_ERROR Error
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_HDC_BUSY
  • PMERR_HRGN_BUSY
  • PMERR_INV_HDC
  • PMERR_INV_HRGN
  • PMERR_INV_IN_AREA
  • PMERR_INV_IN_PATH
  • PMERR_REGION_IS_CLIP_REGION
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.

Remarks

Mixing is controlled only by the area foreground mix. GrePaintRegion returns an error when the region is currently selected as a clip region.

If the preprocessor in the graphics engine receives a GrePaintRegion call for a null region, the preprocessor returns GPI_OK and does not forward the call through the dispatch table to the handling routine. Presentation drivers for devices that do not support BitBlt operations (for example, vector devices such as plotters) do not hook this function. Such drivers hook only the function to return an error code.

Declaration

#define INCL_GRE_REGIONS
#include <os2.h>

HDC      hdc;        /*  Device context handle. */
HRGN     hrgn;       /*  Region handle. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGrePaintRegion. */
LONG     rc;         /*  Return codes. */

rc = GrePaintRegion(hdc, hrgn, pInstance,
       lFunction);