GreCombineRegion: Difference between revisions
Appearance
Created page with "GreCombineRegion combines two regions to make a third. The destination region can be the same as one of the source regions. An error is raised when any one of the specified re..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreCombineRegion combines two regions to make a third. The destination region can be the same as one of the source regions. An error is raised when any one of the specified regions is currently selected as the clip region. All source and target regions must be of the same device class. | GreCombineRegion combines two regions to make a third. The destination region can be the same as one of the source regions. An error is raised when any one of the specified regions is currently selected as the clip region. All source and target regions must be of the same device class. | ||
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 == | ||
GreCombineRegion(hdc, hrgnDst, hrgnSrc1, hrgnSrc2, cmdMode, pInstance, lFunction) | GreCombineRegion(hdc, hrgnDst, hrgnSrc1, hrgnSrc2, cmdMode, pInstance, lFunction) | ||
== Parameters == | == Parameters == | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;hrgnDst (HRGN) - input:Destination region handle. | ||
;hrgnSrc1 (HRGN) - input:First region handle. | |||
;hrgnDst (HRGN) - input | ;hrgnSrc2 (HRGN) - input:Second region handle. | ||
:Destination region handle. | ;cmdMode (LONG) - input:Method of combination. | ||
::CRGN_OR: Union of hrgnSrc1 and hrgnSrc2. | |||
;hrgnSrc1 (HRGN) - input | ::CRGN_COPY: Uses hrgnSrc1 only. hrgnSrc2 is ignored. | ||
:First region handle. | ::CRGN_XOR: Symmetric difference of hrgnSrc1 and hrgnSrc2. | ||
::CRGN_AND: Intersection of hrgnSrc1 and hrgnSrc2. | |||
;hrgnSrc2 (HRGN) - input | ::CRGN_DIFF: Uses hrgnSrc1 and not (hrgnSrc2). | ||
:Second region handle. | ;pInstance (PVOID) - input:Pointer to instance data. | ||
;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreCombineRegion. | |||
;cmdMode (LONG) - input | |||
:Method of combination. | |||
: | |||
: | |||
: | |||
: | |||
: | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreCombineRegion. | |||
== Returns == | == Returns == | ||
;rc (LONG) - returns | ;rc (LONG) - returns:This function returns an integer (lComplexity) indicating the complexity of the new region: | ||
:This function returns an integer (lComplexity) indicating the complexity of the new region: | ::RGN_ERROR: Error | ||
::RGN_NULL: Null region | |||
: | ::RGN_RECT: Rectangular region | ||
::RGN_COMPLEX::Complex region (more than 1 rectangle) | |||
: | :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_HRGN_BUSY | |||
: | :*PMERR_INSUFFICIENT_MEMORY | ||
:*PMERR_INV_COORDINATE | |||
: | :*PMERR_INV_HRGN | ||
::Complex region (more than 1 rectangle) | :*PMERR_INV_LENGTH_OR_COUNT | ||
:*PMERR_INV_RECT | |||
: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_REGION_IS_CLIP_REGION | ||
:*PMERR_HRGN_BUSY | :Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | ||
:*PMERR_INSUFFICIENT_MEMORY | |||
:*PMERR_INV_COORDINATE | |||
:*PMERR_INV_HRGN | |||
:*PMERR_INV_LENGTH_OR_COUNT | |||
:*PMERR_INV_RECT | |||
:*PMERR_REGION_IS_CLIP_REGION | |||
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
== Sample == | == Sample == | ||
Line 81: | Line 54: | ||
rc = GreCombineRegion(hdc, hrgnDst, hrgnSrc1, | rc = GreCombineRegion(hdc, hrgnDst, hrgnSrc1, | ||
hrgnSrc2, cmdMode, pInstance, lFunction); | hrgnSrc2, cmdMode, pInstance, lFunction); | ||
</pre> | </pre> | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 02:22, 24 March 2020
GreCombineRegion combines two regions to make a third. The destination region can be the same as one of the source regions. An error is raised when any one of the specified regions is currently selected as the clip region. All source and target regions must be of the same device class.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
Syntax
GreCombineRegion(hdc, hrgnDst, hrgnSrc1, hrgnSrc2, cmdMode, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- hrgnDst (HRGN) - input
- Destination region handle.
- hrgnSrc1 (HRGN) - input
- First region handle.
- hrgnSrc2 (HRGN) - input
- Second region handle.
- cmdMode (LONG) - input
- Method of combination.
- CRGN_OR: Union of hrgnSrc1 and hrgnSrc2.
- CRGN_COPY: Uses hrgnSrc1 only. hrgnSrc2 is ignored.
- CRGN_XOR: Symmetric difference of hrgnSrc1 and hrgnSrc2.
- CRGN_AND: Intersection of hrgnSrc1 and hrgnSrc2.
- CRGN_DIFF: Uses hrgnSrc1 and not (hrgnSrc2).
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreCombineRegion.
Returns
- rc (LONG) - returns
- This function returns an integer (lComplexity) indicating the complexity of the new region:
- RGN_ERROR: Error
- RGN_NULL: Null region
- RGN_RECT: Rectangular region
- RGN_COMPLEX::Complex region (more than 1 rectangle)
- 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_HRGN_BUSY
- PMERR_INSUFFICIENT_MEMORY
- PMERR_INV_COORDINATE
- PMERR_INV_HRGN
- PMERR_INV_LENGTH_OR_COUNT
- PMERR_INV_RECT
- PMERR_REGION_IS_CLIP_REGION
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Sample
#define INCL_GRE_REGIONS #include <os2.h> HDC hdc; /* Device context handle. */ HRGN hrgnDst; /* Destination region handle. */ HRGN hrgnSrc1; /* First region handle. */ HRGN hrgnSrc2; /* Second region handle. */ LONG cmdMode; /* Method of combination. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreCombineRegion. */ LONG rc; rc = GreCombineRegion(hdc, hrgnDst, hrgnSrc1, hrgnSrc2, cmdMode, pInstance, lFunction);