Jump to content

GpiSetLineEnd

From EDM2
Revision as of 00:47, 24 November 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function sets the current line-end attribute.

Syntax

GpiSetLineEnd(hps, lLineEnd)

Parameters

hps (HPS) - input
Presentation-space handle.
lLineEnd (LONG) - input
Style of line end.

The possible values for this parameter are:
LINEEND_DEFAULT : Use default, same as LINEEND_FLAT (unless changed with GpiSetDefAttrs)
LINEEND_FLAT : Flat
LINEEND_SQUARE : Square
LINEEND_ROUND : Round.

Return Value

rc (BOOL) - returns
Success indicator.
TRUE : Successful completion
FALSE : Error occurred.

Remarks

The line-end attribute defines the shape of the ends of lines or arcs at the beginning and end of an open figure. This attribute is used only in the GpiModifyPath function (with a lMode parameter of MPATH_STROKE) or in the GpiStrokePath function. The attribute mode (see GpiSetAttrMode) determines whether the current value of the line-end 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_END_ATTR (0x2093)
An invalid line end attribute value was specified.

Graphic Elements and Orders

Element Type: OCODE_GSLE

This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE.
Order: Set Line End

Element Type: OCODE_GPSLE

This element type is generated if the attribute mode is set to AM_PRESERVE.
Order: Push and Set Line End

Example Code

This function sets the line end to be square (as opposed to round for example).

#define INCL_GPIPRIMITIVES
#include <OS2.H>

HPS hps; /* Presentation-space handle. */

GpiSetLineEnd(hps, LINEEND_SQUARE);

Related Functions