GpiSetLineWidthGeom: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; ''hps'' ([[HPS]]) - input | ; ''hps'' ([[HPS]]) - input: Presentation-space handle. | ||
: Presentation-space handle. | ; ''lLineWidth'' ([[LONG]]) - input: Geometric line width. | ||
; ''lLineWidth'' ([[LONG]]) - input | |||
: Geometric line width. | |||
: The geometric line width in world coordinates. It must not be negative. | : The geometric line width in world coordinates. It must not be negative. | ||
: A thickness of 0 results in an area of 0 width. Because filling includes the boundaries, this results in the thinnest possible lines and arcs, regardless of what transforms are in force. | : A thickness of 0 results in an area of 0 width. Because filling includes the boundaries, this results in the thinnest possible lines and arcs, regardless of what transforms are in force. | ||
| Line 17: | Line 14: | ||
; ''rc'' ([[BOOL]]) - returns | ; ''rc'' ([[BOOL]]) - returns | ||
: Success indicator. | : Success indicator. | ||
: | ::TRUE: Successful completion | ||
::FALSE: Error occurred. | |||
: | |||
==Remarks== | ==Remarks== | ||
| Line 31: | Line 26: | ||
==Errors== | ==Errors== | ||
Possible returns from WinGetLastError: | Possible returns from WinGetLastError: | ||
; PMERR_INV_HPS (0x207F) | ; PMERR_INV_HPS (0x207F): An invalid presentation-space handle was specified. | ||
: 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_PS_BUSY (0x20F4) | ; PMERR_INV_GEOM_LINE_WIDTH_ATTR (0x2078): An invalid geometric line width attribute value was specified. | ||
: An attempt was made to access the presentation space from more than one thread simultaneously. | |||
; PMERR_INV_GEOM_LINE_WIDTH_ATTR (0x2078) | |||
: An invalid geometric line width attribute value was specified. | |||
==Graphic Elements and Orders== | ==Graphic Elements and Orders== | ||
| Line 48: | Line 40: | ||
==Example Code== | ==Example Code== | ||
This function sets the line width geometry to double the default of 1. | This function sets the line width geometry to double the default of 1. | ||
<pre> | <pre> | ||
#define INCL_GPIPRIMITIVES | #define INCL_GPIPRIMITIVES | ||
#include | #include <OS2.H> | ||
HPS hps; /* Presentation-space handle. */ | HPS hps; /* Presentation-space handle. */ | ||
Latest revision as of 01:45, 24 November 2025
This function sets the current geometric line-width attribute.
Syntax
GpiSetLineWidthGeom(hps, lLineWidth)
Parameters
- hps (HPS) - input
- Presentation-space handle.
- lLineWidth (LONG) - input
- Geometric line width.
- The geometric line width in world coordinates. It must not be negative.
- A thickness of 0 results in an area of 0 width. Because filling includes the boundaries, this results in the thinnest possible lines and arcs, regardless of what transforms are in force.
- The initial default value of the geometric line width is 1. This can be changed with GpiSetDefAttrs. Note: The default line width has been 1 since version 2.0 of the operating system. Prior to that, a wider default line width was used.
Return Value
- rc (BOOL) - returns
- Success indicator.
- TRUE: Successful completion
- FALSE: Error occurred.
Remarks
The geometric line-width attribute is used only in the GpiModifyPath function (with a lMode of MPATH_STROKE) or in the GpiStrokePath function. This attribute specifies the width to be used in converting the lines and arcs, of which the path is composed, into wide lines and arcs. The resulting shape is treated like an area, so the boundaries are considered to be part of its interior. This means that the width of the lines and arcs is one pel wider than the geometric line width transformed to device coordinates. The geometric line width is specified in world-coordinate units, so that, for example, the thickness varies on a zoom operation. Normal line and curve drawing uses only the cosmetic line width (see GpiSetLineWidth). This function must not be issued within an area or path bracket. The attribute mode (see GpiSetAttrMode) determines whether the current value of the geometric line width 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_GEOM_LINE_WIDTH_ATTR (0x2078)
- An invalid geometric line width attribute value was specified.
Graphic Elements and Orders
Element Type: OCODE_GSSLW This element type is generated if the attribute mode (see GpiSetAttrMode) is set to AM_NOPRESERVE. Order: Set Stroke Line Width
Element Type: OCODE_GPSSLW This element type is generated if the attribute mode is set to AM_PRESERVE. Order: Push and Set Stroke Line Width
Example Code
This function sets the line width geometry to double the default of 1.
#define INCL_GPIPRIMITIVES #include <OS2.H> HPS hps; /* Presentation-space handle. */ GpiSetLineWidthGeom(hps, 2L);