Home COM GDI+ WebBrowser Data Access 

Pen Functions (GDI+)

 

 

A Pen object is a Microsoft Windows GDI+ object used to draw lines and curves.

 

Return Values

If the function succeeds, it returns Ok, which is an element of the Status enumeration.

 

If the function fails, it returns one of the other elements of the Status enumeration.

 

GdiClonePen

 

Description

Copies a Pen object.

Syntax

GpStatus WINGDIPAPI GdipClonePen(

    GpPen *pen,

    GpPen **clonepen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipClonePen ( _

    BYVAL pen AS DWORD, _

    BYREF clonepen AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

clonepen

[out] Pointer to a variable that receives a pointer to the new Pen object.

 

GdipCreatePen1

 

Description

Creates a Pen object that uses a specified color and width.

Syntax

GpStatus WINGDIPAPI GdipCreatePen1(

    ARGB color,

    REAL width,

    GpUnit unit,

    GpPen **pen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePen1 ( _

    BYVAL pColor AS DWORD, _

    BYVAL nWidth AS SINGLE, _

    BYVAL unit AS LONG, _

    BYREF pen AS DWORD _

) AS LONG

Parameters

 

color

[in] ARGB color that specifies the color for this Pen object.

width

[in] Single precision value that specifies the width of this pen's stroke. The default value is 1.0.

unit

[in] Unit measure. The default unit of measure is UnitPixel, which is an element of the Unit enumeration.

pen

[out] Pointer to a variable that receives a pointer to the new created Pen object.

 

GdipCreatePen2

 

Description

Creates a Pen object that uses the attributes of a brush and a real number to set the width of this Pen object.

Syntax

GpStatus WINGDIPAPI GdipCreatePen2(

    GpBrush *brush,

    REAL width,

    GpUnit unit,

    GpPen **pen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePen2 ( _

    BYVAL brush AS DWORD, _

    BYVAL nWidth AS SINGLE, _

    BYVAL unit AS LONG, _

    BYREF pen AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to a brush to base this pen on.

width

[in] Single precision value that specifies the width of this pen's stroke. The default value is 1.0.

unit

[in] Unit measure. The default unit of measure is UnitPixel, which is an element of the Unit enumeration.

pen

[out] Pointer to a variable that receives a pointer to the new created Pen object.

 

GdipDeletePen

 

Description

Deletes a Pen object.

Syntax

GpStatus WINGDIPAPI GdipDeletePen(

    GpPen *pen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDeletePen ( _

    BYVAL pen AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

 

GdipGetPenBrushFill

 

Description

Gets the Brush object that is currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenBrushFill(

    GpPen *pen,

    GpBrush **brush

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenBrushFill ( _

    BYVAL pen AS DWORD, _

    BYREF brush AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

brush

[out] Pointer to a variable that receives a pointer to the Brush object that is currently used to fill a line.

 

GdipGetPenColor

 

Description

Gets the color currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenColor(

    GpPen *pen,

    ARGB *argb

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenColor ( _

    BYVAL pen AS DWORD, _

    BYREF pargb AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

argb

[out] Pointer to a variable that receives the color of this Pen object.

 

GdipGetPenCompoundArray

 

Description

Gets the compound array currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenCompoundArray(

    GpPen *pen,

    REAL *dash,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenCompoundArray ( _

    BYVAL pen AS DWORD, _

    BYREF dash AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dash

[out] Pointer to an array that receives the compound array.

count

[in] Long integer value that specifies the number of elements in the dash array.

 

GdipGetPenCompoundCount

 

Description

Gets the number of elements in a compound array.

Syntax

GpStatus WINGDIPAPI GdipGetPenCompoundCount(

    GpPen *pen,

    INT *count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenCompoundCount ( _

    BYVAL pen AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

count

[out] Pointer to a variable that receives the number of elements in the compound array.

Remarks

Suppose that a compound array contains the values 0.0, 0.2, 0.7, and 1.0 and that the pen has a width of 100. When you use the pen to draw, you get two parallel lines. The first line has a width of 20, the space between the two lines has a width of 50, and the second line has a width of 30.

 

For a more complex example, suppose that a compound array contains the values 0.0, 0.2, 0.3, 0.6, 0.85, and 1.0 and that the pen has a width of 100. When you use the pen to draw, you get three parallel lines. The widths of the three lines are 20, 30, and 15 respectively. The widths of the two spaces between the lines are 10 and 15 respectively.

 

GdipGetPenCustomEndCap

 

Description

Gets the custom end cap currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenCustomEndCap(

    GpPen *pen,

    GpCustomLineCap** customCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenCustomEndCap ( _

    BYVAL pen AS DWORD, _

    BYREF customCap AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

customCap

[out] Pointer to a variable that receives the custom end cap of this Pen object.

 

GdipGetPenCustomStartCap

 

Description

Gets the custom start cap currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenCustomStartCap(

    GpPen *pen,

    GpCustomLineCap** customCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenCustomStartCap ( _

    BYVAL pen AS DWORD, _

    BYREF customCap AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

customCap

[out] Pointer to a variable that receives a pointer to the start cap of this Pen object.

 

GdipGetPenDashArray

 

Description

Gets an array of custom dashes and spaces currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenDashArray(

    GpPen *pen,

    REAL *dash,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenDashArray ( _

    BYVAL pen AS DWORD, _

    BYREF dash AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dash

[out] Pointer to an array that receives the length of the dashes and spaces in a custom dashed line.

count

[in] Long integer value that specifies the number of elements in the dash array.

Remarks

The elements in the dash array set the length of each dash and space in the dash pattern. The first element sets the length of a dash, the second element sets the length of a space, the third element sets the length of a dash, and so forth.

 

The length of each dash and space in the dash pattern is the product of each element in the array and the width of the Pen object.

 

GdipGetPenDashCap197819

 

Description

Gets the dash cap style currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenDashCap197819(

    GpPen *pen,

    GpDashCap *dashCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenDashCap197819 ( _

    BYVAL pen AS DWORD, _

    BYREF dashCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dashCap

[out] Pointer to a variable that receives an element of the DashCap enumeration that indicates the dash cap style currently set for this Pen object.

 

GdipGetPenDashCount

 

Description

Gets the number of elements in a dash pattern array.

Syntax

GpStatus WINGDIPAPI GdipGetPenDashCount(

    GpPen *pen,

    INT *count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenDashCount ( _

    BYVAL pen AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

count

[out] Pointer to a variable that receives the number of elements in the dash pattern array.

 

GdipGetPenDashOffset

 

Description

Gets the number of elements in a dash pattern array.

Syntax

GpStatus WINGDIPAPI GdipGetPenDashOffset(

    GpPen *pen,

    REAL *offset

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenDashOffset ( _

    BYVAL pen AS DWORD, _

    BYREF offset AS SINGLE _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

offset

[out] Pointer to a variable that receives the number of elements in the dash pattern array.

 

GdipGetPenDashStyle

 

Description

Gets the number of elements in a dash pattern array.

Syntax

GpStatus WINGDIPAPI GdipGetPenDashStyle(

   GpPen *pen,

   GpDashStyle *dashstyle

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenDashStyle ( _

    BYVAL pen AS DWORD, _

    BYREF dashStyle AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dashStyle

[out] Pointer to a variable that receives the number of elements in the dash pattern array.

 

GdipGetPenEndCap

 

Description

Gets the end cap currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenEndCap(

    GpPen *pen,

    GpLineCap *endCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenEndCap ( _

    BYVAL pen AS DWORD, _

    BYREF endCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

endCap

[out] Pointer to a variable that receives an element of the LineCap enumeration that indicates the end cap for this Pen object.

 

GdipGetPenFillType

 

Description

Gets the type currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenFillType(

    GpPen *pen,

    GpPenType* type

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenFillType ( _

    BYVAL pen AS DWORD, _

    BYREF pType AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

type

[out] Pointer to a variable that receives an element of the PenType enumeration that indicates the style of pen currently set for this Pen object.

 

GdipGetPenLineJoin

 

Description

Gets the line join style currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenLineJoin(

    GpPen *pen,

    GpLineJoin *lineJoin

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenLineJoin ( _

    BYVAL pen AS DWORD, _

    BYREF lineJoin AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

lineJoin

[out] Pointer to a variable that receives an element of the LineJoin enumeration that indicates the style used at the point where line segments join.

 

GdipGetPenMiterLimit

 

Description

Gets the miter length currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenMiterLimit(

    GpPen *pen,

    REAL *miterLimit

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenMiterLimit ( _

    BYVAL pen AS DWORD, _

    BYREF miterLimit AS SINGLE _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

miterLimit

[out] The miter limit of this Pen object.

 

GdipGetPenMode

 

Description

Gets the alignment currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenMode(

    GpPen *pen,

    GpPenAlignment *penMode

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenMode ( _

    BYVAL pen AS DWORD, _

    BYREF penMode AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

penMode

[out] Pointer to a variable that receives an element of the PenAlignment enumeration that indicates the current alignment setting for this Pen object.

 

GdipGetPenStartCap

 

Description

Gets the start cap currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenStartCap(

    GpPen *pen,

    GpLineCap *startCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenStartCap ( _

    BYVAL pen AS DWORD, _

    BYREF startCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

startCap

[out] Pointer to a variable that receives an element of the LineCap enumeration that specifies the start cap for this Pen object.

 

GdipGetPenTransform

 

Description

Gets the world transformation matrix currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenTransform(

    GpPen *pen,

    GpMatrix *matrix

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenTransform ( _

    BYVAL pen AS DWORD, _

    BYVAL matrix AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

matrix

[out] Pointer to a variable that receives the transformation matrix.

 

GdipGetPenUnit

 

Description

Gets the world transformation matrix currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenUnit(

    GpPen *pen,

    GpUnit *unit

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenUnit ( _

    BYVAL pen AS DWORD, _

    BYREF unit AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

unit

[out] Pointer to a variable that receives a member of the Unit enumeration that indicates the unit of measure for the width of the pen.

 

GdipGetPenWidth

 

Description

Gets the width currently set for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipGetPenWidth(

    GpPen *pen,

    REAL *width

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPenWidth ( _

    BYVAL pen AS DWORD, _

    BYREF nWidth AS SINGLE _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

width

[out] Pointer to a variable that receives the width of this Pen object.

 

GdipMultiplyPenTransform

 

Description

Updates the world transformation matrix of this Pen object with the product of itself and another matrix.

Syntax

GpStatus WINGDIPAPI GdipMultiplyPenTransform(

    GpPen *pen,

    GDIPCONST GpMatrix *matrix,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipMultiplyPenTransform ( _

    BYVAL pen AS DWORD, _

    BYVAL matrix AS DWORD, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

matrix

[in] Pointer to a Matrix object that is multiplied with the world transformation matrix of this Pen object.

order

[in] Element of the MatrixOrder enumeration that specifies the order of the multiplication. MatrixOrderPrepend specifies that the passed matrix is on the left, and MatrixOrderAppend specifies that the passed matrix is on the right. The default value is MatrixOrderPrepend.

 

GdipResetPenTransform

 

Description

Sets the world transformation matrix of this Pen object to the identity matrix.

Syntax

GpStatus WINGDIPAPI GdipResetPenTransform(

    GpPen *pen

);

PowerBASIC Syntax

DECLARE FUNCTION GdipResetPenTransform ( _

    BYVAL pen AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

 

GdipRotatePenTransform

 

Description

Updates the world transformation matrix of this Pen object with the product of itself and a rotation matrix.

Syntax

GpStatus WINGDIPAPI GdipRotatePenTransform(

    GpPen *pen,

    REAL angle,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRotatePenTransform ( _

    BYVAL pen AS DWORD, _

    BYVAL angle AS SINGLE, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

angle

[in] Real number that specifies the angle of rotation in degrees.

order

[in] Element of the MatrixOrder enumeration that specifies the order of the multiplication. MatrixOrderPrepend specifies that the rotation matrix is on the left, and MatrixOrderAppend specifies that the rotation matrix is on the right. The default value is MatrixOrderPrepend.

 

GdipScalePenTransform

 

Description

Sets the Pen object's world transformation matrix equal to the product of itself and a scaling matrix.

Syntax

GpStatus WINGDIPAPI GdipScalePenTransform(

    GpPen *pen,

    REAL sx,

    REAL sy,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipScalePenTransform ( _

    BYVAL pen AS DWORD, _

    BYVAL sx AS SINGLE, _

    BYVAL sy AS SINGLE, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

sx

[in] Single precision value that specifies the horizontal scaling factor in the scaling matrix.

sy

[in] Single precision value that specifies the vertical scaling factor in the scaling matrix.

order

[in] Element of the MatrixOrder enumeration that specifies the order of the multiplication. MatrixOrderPrepend specifies that the scaling matrix is on the left, and MatrixOrderAppend specifies that the scaling matrix is on the right. The default value is MatrixOrderPrepend.

 

GdipSetPenBrushFill

 

Description

Sets the Brush object that a pen uses to fill a line.

Syntax

GpStatus WINGDIPAPI GdipSetPenBrushFill(

    GpPen *pen,

    GpBrush *brush

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenBrushFill ( _

    BYVAL pen AS DWORD, _

    BYVAL brush AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

brush

[in] Pointer to a Brush object for the pen to use to fill a line.

 

GdipSetPenColor

 

Description

Sets the color for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenColor(

    GpPen *pen,

    ARGB argb

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenColor ( _

    BYVAL pen AS DWORD, _

    BYVAL pargb AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

argb

[in] ARGB color that specifies the color for this Pen object.

 

GdipSetPenCompoundArray

 

Description

Sets the compound array for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenCompoundArray(

    GpPen *pen,

    GDIPCONST REAL *dash,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenCompoundArray ( _

    BYVAL pen AS DWORD, _

    BYREF dash AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dash

[in] Pointer to an array of real numbers that specifies the compound array. The elements in the array must be in increasing order, not less than 0, and not greater than 1.

count

[in] Positive even integer that specifies the number of elements in the dash array. The integer must not be greater than the number of elements in the compound array.

 

GdipSetPenCustomEndCap

 

Description

Sets the custom end cap for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenCustomEndCap(

    GpPen *pen,

    GpCustomLineCap* customCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenCustomEndCap ( _

    BYVAL pen AS DWORD, _

    BYVAL customCap AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

customCap

[in] Pointer to a CustomLineCap object that specifies the custom end cap for this Pen object.

 

GdipSetPenCustomStartCap

 

Description

Sets the custom start cap for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenCustomStartCap(

    GpPen *pen,

    GpCustomLineCap* customCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenCustomStartCap ( _

    BYVAL pen AS DWORD, _

    BYVAL customCap AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

customCap

[in] Pointer to a CustomLineCap object that specifies the custom start cap for this Pen object.

 

GdipSetPenDashArray

 

Description

Sets an array of custom dashes and spaces for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenDashArray(

    GpPen *pen,

    GDIPCONST REAL *dash,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenDashArray ( _

    BYVAL pen AS DWORD, _

    BYREF dash AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dash

[in] Pointer to an array of real numbers that specifies the length of the custom dashes and spaces. All elements in the array must be positive real numbers.

count

[in] Long integer that specifies the number of elements in the dash array. The integer must be greater than 0 and not greater than the total number of elements in the array.

Remarks

This method will set the DashStyle enumeration for this Pen object to DashStyleCustom.

 

The elements in the dash array set the length of each dash and space in the dash pattern. The first element sets the length of a dash, the second element sets the length of a space, the third element sets the length of a dash, and so forth.

 

The length of each dash and space in the dash pattern is the product of the element value in the array and the width of the Pen object.

 

GdipSetPenDashCap197819

 

Description

Sets the dash cap style for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenDashCap197819(

    GpPen *pen,

    GpDashCap dashCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenDashCap197819 ( _

    BYVAL pen AS DWORD, _

    BYVAL dashCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dashCap

[in] Element of the DashCap enumeration that specifies the dash cap for this Pen object.

Remarks

If you set the alignment of a Pen object to PenAlignmentInset, you cannot use that pen to draw triangular dash caps.

 

GdipSetPenDashOffset

 

Description

Sets the distance from the start of the line to the start of the first dash in a dashed line.

Syntax

GpStatus WINGDIPAPI GdipSetPenDashOffset(

    GpPen *pen,

    REAL offset

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenDashOffset ( _

    BYVAL pen AS DWORD, _

    BYVAL offset AS SINGLE _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

offset

[in] Single precision value that specifies the number of times to shift the spaces in a dashed line. Each shift is equal to the length of a space in the dashed line.

Remarks

A positive offset value shifts the first dash forward along the path, and a negative offset value shifts the start of the path forward along the first dash.

 

GdipSetPenDashStyle

 

Description

Sets the dash style for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenDashStyle(

    GpPen *pen,

    GpDashStyle dashstyle

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenDashStyle ( _

    BYVAL pen AS DWORD, _

    BYVAL dashStyle AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dashStyle

[in] Single precision value that specifies the number of times to shift the spaces in a dashed line. Each shift is equal to the length of a space in the dashed line.

Remarks

The length of the dashes in a dashed line is dependent on the dash style and the width of the Pen object. The length of the space that separates two dashes in a dashed line is equal to the width of the Pen object.

 

GdipSetPenEndCap

 

Description

Sets the end cap for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenEndCap(

    GpPen *pen,

    GpLineCap endCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenEndCap ( _

    BYVAL pen AS DWORD, _

    BYVAL endCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

endCap

[in] Element of the LineCap enumeration that specifies the end cap of a line.

 

GdipSetPenLineCap197819

 

Description

Sets the cap styles for the start, end, and dashes in a line drawn with this pen.

Syntax

GpStatus WINGDIPAPI GdipSetPenLineCap197819(

    GpPen *pen,

    GpLineCap startCap,

    GpLineCap endCap,

    GpDashCap dashCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenLineCap197819 ( _

    BYVAL pen AS DWORD, _

    BYVAL startCap AS LONG, _

    BYVAL endCap AS LONG, _

    BYVAL dashCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

startCap

[in] Element of the LineCap enumeration that specifies the start cap of a line.

endCap

[in] Element of the LineCap enumeration that specifies the end cap of a line.

dashCap

[in] Element of the DashCap enumeration that specifies the start and end caps of the dashes in a dashed line.

 

GdipSetPenLineJoin

 

Description

Sets the line join for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenLineJoin(

    GpPen *pen,

    GpLineJoin lineJoin

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenLineJoin ( _

    BYVAL pen AS DWORD, _

    BYVAL lineJoin AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

lineJoin

[in] Element of the LineJoin enumeration that specifies the join style used at the end of a line segment that meets another line segment.

 

GdipSetPenMiterLimit

 

Description

Sets the miter limit of this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenMiterLimit(

    GpPen *pen,

    REAL miterLimit

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenMiterLimit ( _

    BYVAL pen AS DWORD, _

    BYVAL miterLimit AS SINGLE _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

miterLimit

[in] Single precision value that specifies the miter limit of this Pen object. A real number value that is less than 1.0f will be replaced with 1.0f.

Remarks

The miter length is the distance from the intersection of the line walls on the inside of the join to the intersection of the line walls outside of the join. The miter length can be large when the angle between two lines is small. The miter limit is the maximum allowed ratio of miter length to stroke width. The default value is 10.0f.

 

If the miter length of the join of the intersection exceeds the limit of the join, then the join will be beveled to keep it within the limit of the join of the intersection.

 

GdipSetPenMode

 

Description

Sets the alignment for this Pen object relative to the line.

Syntax

GpStatus WINGDIPAPI GdipSetPenMode(

    GpPen *pen,

    GpPenAlignment penMode

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenMode ( _

    BYVAL pen AS DWORD, _

    BYVAL penMode AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

penMode

[in] Element of the PenAlignment enumeration that specifies the alignment setting of the pen relative to the line that is drawn. The default value is PenAlignmentCenter.

Remarks

If you set the alignment of a Pen object to PenAlignmentInset, you cannot use that pen to draw compound lines or triangular dash caps.

 

GdipSetPenStartCap

 

Description

Sets the start cap for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenStartCap(

    GpPen *pen,

    GpLineCap startCap

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenStartCap ( _

    BYVAL pen AS DWORD, _

    BYVAL startCap AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

startCap

[in] Element of the LineCap enumeration that specifies the start cap of a line.

 

GdipSetPenTransform

 

Description

Sets the world transformation of this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenTransform(

    GpPen *pen,

    GpMatrix *matrix

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenTransform ( _

    BYVAL pen AS DWORD, _

    BYVAL matrix AS DWORD _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

matrix

[in] Pointer to a Matrix object that specifies the world transformation.

Remarks

This method ignores the translation portion of the Matrix object.

 

GdipSetPenUnit

 

Description

Sets the unit of measure for the pen specified by the pen parameter to the value specified by the unit parameter.

Syntax

GpStatus WINGDIPAPI GdipSetPenUnit(

    GpPen *pen,

    GpUnit unit

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenUnit ( _

    BYVAL pen AS DWORD, _

    BYVAL unit AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

unit

[in] The unit parameter is a member of the Unit enumeration that specifies the unit of measure for the width of the pen.

 

GdipSetPenWidth

 

Description

Sets the width for this Pen object.

Syntax

GpStatus WINGDIPAPI GdipSetPenWidth(

    GpPen *pen,

    REAL width

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPenWidth ( _

    BYVAL pen AS DWORD, _

    BYVAL nWidth AS SINGLE _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

width

[in] Single precision value that specifies the width of the pen.

 

GdipTranslatePenTransform

 

Description

Translates the local geometric transformation by the specified dimensions. This method prepends the translation to the transformation.

Syntax

GpStatus WINGDIPAPI GdipTranslatePenTransform(

    GpPen *pen,

    REAL dx,

    REAL dy,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipTranslatePenTransform ( _

    BYVAL pen AS DWORD, _

    BYVAL dx AS SINGLE, _

    BYVAL dy AS SINGLE, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

pen

[in] Pointer to the Pen object.

dx

[in] Single precision value that specifies the horizontal component of the translation.

dy

[in] Single precision value that specifies the vertical component of the translation.

order

[in] Element of the MatrixOrder enumeration that specifies the order of the multiplication. MatrixOrderPrepend specifies that the translation matrix is on the left, and MatrixOrderAppend specifies that the translation matrix is on the right. The default value is MatrixOrderPrepend.

 

Page last updated on Monday, 11 December 2006 11:01:46 +0100