GpiSetLineJoin
This function sets the current line-join attribute.
Syntax
GpiSetLineJoin(hps, lLineJoin)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lLineJoin (LONG) - input
- Style of line join.
- The possible values for this parameter are:
- LINEJOIN_DEFAULT
- Use default, same as LINEJOIN_BEVEL (unless changed with GpiSetDefAttrs)
- LINEJOIN_BEVEL
- Bevel
- LINEJOIN_ROUND
- Round
- LINEJOIN_MITRE
- Miter.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE
- Successful completion
- FALSE
- Error occurred.
Remarks
The line-join attribute defines how individual lines and arcs within a figure are joined together. This attribute is used only during a GpiModifyPath function (with a lMode parameter of MPATH_STROKE) or a GpiStrokePath function. For LINEJOIN_MITRE, where the lines going into a join are nearly parallel (a very sharp change in direction), a miter join could potentially extend to a distance that approaches infinity. To prevent this, whenever the ratio of the miter length to the geometric line width exceeds 10, a bevel join is drawn instead. (The miter length is the distance from the point at which the inner edges of the wideline intersect, to the point at which the outer edges of the wideline intersect.) The attribute mode (see GpiSetAttrMode) determines whether the current value of the line-join attribute is preserved.
Errors
Possible returns from WinGetLastError:
- PMERR_INV_HPS (0x207F)
- An invalid presentation-space handle was specified.
- PMERR_PS_BUSY (0x20F4)
- An attempt was made to access the presentation space from more than one thread simultaneously.
- PMERR_INV_LINE_JOIN_ATTR (0x2094)
- An invalid line join attribute value was specified.
Graphic Elements and Orders
Element Type: OCODE_GSLJ
- This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.
- Order: Set Line Join
Element Type: OCODE_GPSLJ
- This element type is generated if the attribute mode is set to AM_PRESERVE.
- Order: Push and Set Line Join
Example Code
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */ #include <os2.h> HPS hps; /* Presentation-space handle. */ LONG lLineJoin; /* Style of line join. */ BOOL rc; /* Success indicator. */ rc = GpiSetLineJoin(hps, lLineJoin);
This function sets the line-join to be round (as opposed to bevel or miter).
#define INCL_GPIPRIMITIVES #include <OS2.H> HPS hps; /* Presentation-space handle. */ GpiSetLineEnd(hps, LINEJOIN_ROUND);