GreRectInRegion: Difference between revisions
Appearance
Created page with "GreRectInRegion checks whether any part of a given rectangle lies within the specified region. GreRectInRegion raises an error if hrgn is the handle of the currently selected ..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
GreRectInRegion checks whether any part of a given rectangle lies within the specified region. GreRectInRegion raises an error if hrgn is the handle of the currently selected clip region. | GreRectInRegion checks whether any part of a given rectangle lies within the specified region. GreRectInRegion raises an error if hrgn is the handle of the currently selected clip region. | ||
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== | ||
GreRectInRegion(hdc, hrgn, prclRect, pInstance, lFunction) | GreRectInRegion(hdc, hrgn, prclRect, pInstance, lFunction) | ||
==Parameters== | ==Parameters== | ||
;hdc (HDC) - input | ;hdc (HDC) - input:Device context handle. | ||
:Device context handle. | ;hrgn (HRGN) - input:Region handle. | ||
;prclRect (P[[RECTL]]) - input:Pointer to rectangle in device coordinates. | |||
;hrgn (HRGN) - input | :RECTL structure: | ||
:Region handle. | :*xLeft Minimum x-coordinate of rectangle | ||
:*yBottom Minimum y-coordinate | |||
;prclRect ( | :*xRight Maximum x-coordinate of rectangle | ||
:Pointer to rectangle in device coordinates. | :*yTop Maximum y-coordinate | ||
:The rectangle passed is considered "exclusive" on the right and top sides. If the rectangle represents the bounding box of a graphic object to be drawn, the drawing might include the right and top sides. In this case, the caller should "inflate" the top and right sides by one unit in device-coordinate space. | |||
:RECTL structure: | ;pInstance (PVOID) - input:Pointer to instance data. | ||
:*xLeft Minimum x-coordinate of rectangle | ;lFunction (ULONG) - input:High-order WORD=flags; low-order WORD=NGreRectInRegion. | ||
:*yBottom Minimum y-coordinate | |||
:*xRight Maximum x-coordinate of rectangle | |||
:*yTop Maximum y-coordinate | |||
:The rectangle passed is considered "exclusive" on the right and top sides. If the rectangle represents the bounding box of a graphic object to be drawn, the drawing might include the right and top sides. In this case, the caller should "inflate" the top and right sides by one unit in device-coordinate space. | |||
;pInstance (PVOID) - input | |||
:Pointer to instance data. | |||
;lFunction (ULONG) - input | |||
:High-order WORD=flags; low-order WORD=NGreRectInRegion. | |||
==Return Code== | ==Return Code== | ||
;rc (LONG) - returns | ;rc (LONG) - returns:Return codes. | ||
:Return codes. | :This function returns an integer (lInside) indicating whether the rectangle is inside the region: | ||
:*RRGN_ERROR Error | |||
:This function returns an integer (lInside) indicating whether the rectangle is inside the region: | :*RRGN_INSIDE All in region | ||
:*RRGN_PARTIAL Partially in region | |||
:*RRGN_ERROR Error | :*RRGN_OUTSIDE Not in region | ||
:*RRGN_INSIDE All in region | :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: | ||
:*RRGN_PARTIAL Partially in region | :*PMERR_HRGN_BUSY | ||
:*RRGN_OUTSIDE Not in region | :*PMERR_INV_COORDINATE | ||
:*PMERR_INV_HRGN | |||
:Possible Errors Detected: | :*PMERR_INV_RECT | ||
:*PMERR_REGION_IS_CLIP_REGION | |||
:*PMERR_HRGN_BUSY | :Refer to the "Error Explanations" section in the ''Presentation Manager Programming Reference'' for further explanation. | ||
:*PMERR_INV_COORDINATE | |||
:*PMERR_INV_HRGN | |||
:*PMERR_INV_RECT | |||
:*PMERR_REGION_IS_CLIP_REGION | |||
:Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation. | |||
==Declaration== | ==Declaration== | ||
Line 65: | Line 49: | ||
rc = GreRectInRegion(hdc, hrgn, prclRect, pInstance, lFunction); | rc = GreRectInRegion(hdc, hrgn, prclRect, pInstance, lFunction); | ||
</PRE> | </PRE> | ||
[[Category:Gre]] | [[Category:Gre]] |
Latest revision as of 01:30, 25 March 2020
GreRectInRegion checks whether any part of a given rectangle lies within the specified region. GreRectInRegion raises an error if hrgn is the handle of the currently selected clip region.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
Syntax
GreRectInRegion(hdc, hrgn, prclRect, pInstance, lFunction)
Parameters
- hdc (HDC) - input
- Device context handle.
- hrgn (HRGN) - input
- Region handle.
- prclRect (PRECTL) - input
- Pointer to rectangle in device coordinates.
- RECTL structure:
- xLeft Minimum x-coordinate of rectangle
- yBottom Minimum y-coordinate
- xRight Maximum x-coordinate of rectangle
- yTop Maximum y-coordinate
- The rectangle passed is considered "exclusive" on the right and top sides. If the rectangle represents the bounding box of a graphic object to be drawn, the drawing might include the right and top sides. In this case, the caller should "inflate" the top and right sides by one unit in device-coordinate space.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreRectInRegion.
Return Code
- rc (LONG) - returns
- Return codes.
- This function returns an integer (lInside) indicating whether the rectangle is inside the region:
- RRGN_ERROR Error
- RRGN_INSIDE All in region
- RRGN_PARTIAL Partially in region
- RRGN_OUTSIDE Not in region
- 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_INV_COORDINATE
- PMERR_INV_HRGN
- PMERR_INV_RECT
- PMERR_REGION_IS_CLIP_REGION
- Refer to the "Error Explanations" section in the Presentation Manager Programming Reference for further explanation.
Declaration
#define INCL_GRE_REGIONS #include <os2.h> HDC hdc; /* Device context handle. */ HRGN hrgn; /* Region handle. */ PRECTL prclRect; /* Pointer to rectangle in device coordinates. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreRectInRegion. */ LONG rc; /* Return codes. */ rc = GreRectInRegion(hdc, hrgn, prclRect, pInstance, lFunction);