GreBoxInterior
Description GreBoxInterior draws a rectangular box with one corner at the current (X,Y) position and the opposite corner at the specified (X,Y) position. The current (X,Y) position does not change. When this function occurs within an area or path definition, it generates a closed figure. GreBoxInterior must not occur within any other figure definition.
This function can be hooked by the presentation driver.
- Simulation support
- This function is simulated by a handling routine in the graphics engine.
Syntax
GreBoxInterior(hdc, pBox, pInstance, lFunction);
Parameters
- hdc (HDC) - input
- Device context handle.
- pBox (PPOINTL) - input
- Pointer to a BOXDATA structure.
- ptlOpposite
- POINTL structure defining the opposite corner of the box. If COM_TRANSFORM is not set, the function expects the point to be in screen coordinates.
- x
- X-coordinate of opposite corner
- y
- Y-coordinate of opposite corner
- lHRound Horizontal length of the full axis of an ellipse. This field is used for rounding each corner.
- lVRound Vertical length of the full axis of an ellipse. This field is used for rounding each corner.
- pInstance (PVOID) - input
- Pointer to instance data.
- lFunction (ULONG) - input
- High-order WORD=flags; low-order WORD=NGreBoxInterior.
Return Code
- rc (LONG) - returns
- On completion, this function returns an integer (cHits) indicating, where appropriate, whether correlation hits were detected.
Remarks
The sides of the box (before transformation) are parallel to the X-axis and Y-axis. The corners of the box can be rounded by means of quarter ellipses of the specified diameters. When the value of either diameter is 0, no rounding occurs. When the value of either diameter exceeds the length of the corresponding side, that length is used as the diameter instead. When the value of the diameters are equal to the value of the sides, the corners are rounded with a quarter circle. If the current position is (x0, y0), the box is drawn from the current position in a counterclockwise direction. This is significant when, for example, the area mode is BA_WINDING.
When correlating, the handling routine records a hit when the pick aperture intersects, or is completely within, the interior (even if the mix used for the fill operation is LEAVEALONE).
Sample Code
#define INCL_GRE_ARCS #include <os2.h> HDC hdc; /* Device context handle. */ PPOINTL pBox; /* Pointer to a BOXDATA structure. */ PVOID pInstance; /* Pointer to instance data. */ ULONG lFunction; /* High-order WORD=flags; low-order WORD=NGreBoxInterior. */ LONG rc; rc = GreBoxInterior(hdc, pBox, pInstance, lFunction);