Jump to content

GreCreateRectRegion: Difference between revisions

From EDM2
Created page with "GreCreateRectRegion creates a region by taking the OR of a series of rectangles. When no rectangles are specified (that is, cRect is 0), an empty region is created. If COM_TRA..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
GreCreateRectRegion creates a region by taking the OR of a series of rectangles. When no rectangles are specified (that is, cRect is 0), an empty region is created. If COM_TRANSFORM is not set, the function expects the points to be in device coordinates.  
GreCreateRectRegion creates a region by taking the OR of a series of rectangles. When no rectangles are specified (that is, cRect is 0), an empty region is created. If COM_TRANSFORM is not set, the function expects the points to be in device coordinates.


This function can be hooked by the presentation driver.  
This function can be hooked by the presentation driver.


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


== Syntax ==  
== Syntax ==  
  GreCreateRectRegion(hdc, paRegion, cRect, pInstance, lFunction);
  GreCreateRectRegion(hdc, paRegion, cRect, pInstance, lFunction)


== Parameters ==
== Parameters ==
;hdc (HDC) - input  
;hdc (HDC) - input:Device context handle.
:Device context handle.  
;paRegion (PRECT) - input:Pointer to the region definition.  
 
:This is a pointer to an array of rectangle structures, which defines the region. Each rectangle is described by a [[RECTL]] structure.
;paRegion (PRECT) - input  
;cRect (LONG) - input:Number of rectangles in the region definition.
:Pointer to the region definition.  
:If this is 0, an empty region is created.
 
;pInstance (PVOID) - input:Pointer to instance data.
:This is a pointer to an array of rectangle structures, which defines the region. Each rectangle is described by a RECTL structure:
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreCreateRectRegion.
 
:;xLeft
::Minimum x-coordinate of rectangle
:;yBottom
::Minimum y-coordinate
:;xRight
::Maximum x-coordinate of rectangle
:;yTop
::Maximum y-coordinate
 
:For each rectangle, xRight must be equal to or greater than xLeft. yTop must be equal to or greater than yBottom. The bottom and left boundaries of each rectangle are part of the interior of the region; the top and right boundaries are not.  
 
;cRect (LONG) - input  
:Number of rectangles in the region definition.  
 
:If this is 0, an empty region is created.  
 
;pInstance (PVOID) - input  
:Pointer to instance data.  
 
;lFunction (ULONG) - input  
:High-order WORD=flags; low-order WORD=NGreCreateRectRegion.  


== Returns ==
== Returns ==
;rc (HRGN) - returns  
;rc (HRGN) - returns:Return codes.
:Return codes.  
:On completion, the handling routine returns the region handle (hrgn), or RGN_ERROR if 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:
:On completion, the handling routine returns the region handle (hrgn), or RGN_ERROR if an error occurred.  
:*PMERR_INSUFFICIENT_MEMORY
 
:*PMERR_INV_COORDINATE
: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_HRGN
 
:*PMERR_INV_LENGTH_OR_COUNT
:*PMERR_INSUFFICIENT_MEMORY  
:*PMERR_INV_RECT
:*PMERR_INV_COORDINATE  
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
:*PMERR_INV_HRGN  
:*PMERR_INV_LENGTH_OR_COUNT  
:*PMERR_INV_RECT  
 
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.  
 
== Sample ==
<pre>
#define INCL_GRE_REGIONS
#include <os2.h>
 
HDC      hdc;        /*  Device context handle. */
PRECT    paRegion;  /*  Pointer to the region definition. */
LONG    cRect;      /*  Number of rectangles in the region definition. */
PVOID    pInstance;  /*  Pointer to instance data. */
ULONG    lFunction;  /*  High-order WORD=flags; low-order WORD=NGreCreateRectRegion. */
HRGN    rc;        /*  Return codes. */
 
rc = GreCreateRectRegion(hdc, paRegion, cRect,
      pInstance, lFunction);
</pre>


[[Category:Gre]]
[[Category:Gre]]

Latest revision as of 20:25, 17 January 2020

GreCreateRectRegion creates a region by taking the OR of a series of rectangles. When no rectangles are specified (that is, cRect is 0), an empty region is created. If COM_TRANSFORM is not set, the function expects the points to be in device coordinates.

This function can be hooked by the presentation driver.

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

Syntax

GreCreateRectRegion(hdc, paRegion, cRect, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
paRegion (PRECT) - input
Pointer to the region definition.
This is a pointer to an array of rectangle structures, which defines the region. Each rectangle is described by a RECTL structure.
cRect (LONG) - input
Number of rectangles in the region definition.
If this is 0, an empty region is created.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low-order WORD=NGreCreateRectRegion.

Returns

rc (HRGN) - returns
Return codes.
On completion, the handling routine returns the region handle (hrgn), or RGN_ERROR if 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_INSUFFICIENT_MEMORY
  • PMERR_INV_COORDINATE
  • PMERR_INV_HRGN
  • PMERR_INV_LENGTH_OR_COUNT
  • PMERR_INV_RECT
Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.