 
  
    Important Notice
  
  
    The pages on this site contain documentation for very old MS-DOS software,
    purely for historical purposes.
    If you're looking for up-to-date documentation, particularly for programming,
    you should not rely on the information found here, as it will be woefully
    out of date.
  
 
 GpiPaintRegion (1.2)
◄Function Group►  ◄Overview►                          ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIREGIONS
 
LONG GpiPaintRegion(hps, hrgn)
HPS hps;      /* presentation-space handle */
HRGN hrgn;    /* region handle             */
 
The GpiPaintRegion function paints the region specified by the hrgn
parameter. The function paints a region by filling it with the current fill
pattern, applying the current area colors and mix modes as it fills the
region.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
hrgn       Identifies the region.
 
Return Value
 
The return value is GPI_OK or GPI_HITS if the function is successful (it is
GPI_HITS if the detectable attribute is set for the presentation space and a
correlation hit occurs). The return value is GPI_ERROR if an error occurs.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_HPS
     PMERR_INV_HRGN
     PMERR_PS_BUSY
 
Example
 
This example uses the GpiPaintRegion function to fill a complex region
consisting of three, intersecting rectangles. The region is filled with a
red, diagonal pattern.
 
HRGN hrgn;                               /* handle for region */
RECTL arcl[3] = { 100, 100, 200, 200,    /* 1st rectangle     */
    150, 150, 250, 250,                  /* 2nd rectangle     */
    200, 200, 300, 300 };                /* 3rd rectangle     */
 
hrgn = GpiCreateRegion(hps, 3L, arcl);
GpiSetColor(hps, CLR_RED);
GpiSetPattern(hps, PATSYM_DIAG1);
GpiPaintRegion(hps, hrgn);
 
See Also
 
GpiCreateRegion, GpiSetAttrs, GpiSetColor, GpiSetPattern,
GpiSetPatternRefPoint, GpiSetPatternSet
 
                                      ♦