Jump to content

GreBeginArea: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
mNo edit summary
Line 73: Line 73:
fSuccess = GreBeginArea(hdc, flOptions, pInstance, lFunction);
fSuccess = GreBeginArea(hdc, flOptions, pInstance, lFunction);
</PRE>
</PRE>
==Related Functions==
*


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

Revision as of 19:48, 19 November 2019

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

GreBeginArea indicates the beginning of a set of drawing functions that define the boundary of an area. All of the boundaries of the area are considered to be part of the interior and are filled. This function can be hooked by the presentation driver.

Syntax

GreBeginArea (hdc, flOptions, pInstance, lFunction)

Parameters

hdc (HDC) - input
Device context handle.
flOptions (ULONG) - input
These flags designate whether the boundary is drawn and what the drawing mode is.
The defaults are BA_NOBOUNDARY and BA_ALTERNATE.
BA_NOBOUNDARY Do not draw boundary lines.
BA_BOUNDARY Draw boundary lines.
BA_ALTERNATE Alternate mode.
BA_WINDING Winding mode.
BA_EXCL Fill exclusive of bottom and right border in device coordinate. New on graphical engine versions 236 and later.
pInstance (PVOID) - input
Pointer to instance data.
lFunction (ULONG) - input
High-order WORD=flags; low order WORD=NGreBeginArea.

Return Code

fSuccess (BOOL) - returns
This function returns BOOLEAN (fSuccess).
Area correlation hits are returned at End Area time. No hits are returned for primitives, such as lines and arcs, that form part of the area definition.
TRUE Successful
FALSE Error 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_ALREADY_IN_AREA
PMERR_BASE_ERROR
PMERR_COORDINATE_OVERFLOW
PMERR_DEV_FUNC_NOT_INSTALLED
PMERR_HDC_BUSY
PMERR_INV_AREA_CONTROL
PMERR_INV_COORD_SPACE
PMERR_INV_HDC
PMERR_INV_IN_PATH
PMERR_INV_LENGTH_OR_COUNT
PMERR_PATH_LIMIT_EXCEEDED
Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.

Remarks

GreBeginArea has no direct effect on current position, although it can be affected by drawing orders within the boundary definition. When GreBoxxxx or GreFullArcxxx functions are used within an area definition, they generate closed figures and must not be used within another figure definition. For more information, see "GpiBeginArea" in the Presentation Manager Programming Reference.

The following functions are valid when received after GreBeginArea and before GreEndArea:

  • GreArc
  • GreAreaSetAttributes (valid only for color, mix, and valid line attributes)
  • GreBoxBoundary
  • GreDeviceSetAttributes (valid only for color, mix, and valid line attributes)
  • GreDeviceSetGlobalAttribute (valid only for foreground color and mix)
  • GreFullArcBoundary
  • GrePartialArc
  • GrePolyFillet
  • GrePolyFilletSharp
  • GrePolyLine
  • GrePolySpline
  • GreQueryCharStringPos
  • GreQueryTextBox
  • GreSetArcParameters
  • GreSetAttributes (valid only for color, mix, and valid line attributes)
  • GreSetCurrentPosition
  • GreSetGlobalAttribute (valid only for foreground color and mix)
  • GreSetModelXform

Example Code

#define INCL_GRE_PATHS
#include <os2.h>

HDC    hdc;        /*  Device context handle. */
ULONG  flOptions;
PVOID  pInstance;  /*  Pointer to instance data. */
ULONG  lFunction;
BOOL   fSuccess;

fSuccess = GreBeginArea(hdc, flOptions, pInstance, lFunction);