Jump to content

GpiSetLineJoin: Difference between revisions

From EDM2
Created page with "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. Image:GpiSetLineJoin_lLineJoin.png : 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_MITR..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; ''hps'' ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
; ''lLineJoin'' ([[LONG]]) - input: Style of line join.
 
; lLineJoin ([[LONG]]) - input
: Style of line join.


[[Image:GpiSetLineJoin_lLineJoin.png]]
[[Image:GpiSetLineJoin_lLineJoin.png]]
: The possible values for this parameter are:
: The possible values for this parameter are:
:; LINEJOIN_DEFAULT
:: LINEJOIN_DEFAULT: Use default, same as LINEJOIN_BEVEL (unless changed with [[GpiSetDefAttrs]])
:: Use default, same as LINEJOIN_BEVEL (unless changed with [[GpiSetDefAttrs]])
:: LINEJOIN_BEVEL: Bevel
:; LINEJOIN_BEVEL
:: LINEJOIN_ROUND: Round
:: Bevel
:: LINEJOIN_MITRE: Miter.
:; LINEJOIN_ROUND
:: Round
:; LINEJOIN_MITRE
:: Miter.


==Return Value==
==Return Value==
; rc ([[BOOL]]) - returns
; ''rc'' ([[BOOL]]) - returns: Success indicator.
: Success indicator.
::TRUE: Successful completion
:; TRUE
::FALSE: Error occurred.
:: Successful completion
:; FALSE
:: Error occurred.


==Remarks==
==Remarks==
Line 54: Line 44:


==Example Code==
==Example Code==
<PRE>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS    hps;      /* Presentation-space handle. */
LONG    lLineJoin; /* Style of line join. */
BOOL    rc;        /* Success indicator. */
rc = GpiSetLineJoin(hps, lLineJoin);
</PRE>
This function sets the line-join to be round (as opposed to bevel or miter).
This function sets the line-join to be round (as opposed to bevel or miter).
<pre>
<pre>
#define INCL_GPIPRIMITIVES
#define INCL_GPIPRIMITIVES
#include &lt;OS2.H&gt;
#include <OS2.H>


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

Latest revision as of 02:17, 24 November 2025

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

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);

Related Functions