Home COM GDI+ WebBrowser Data Access 

PathGradientBrush Functions (GDI+)

 

 

The PathGradientBrush functions allow to set the attributes of a color gradient that you can use to fill the interior of a path with a gradually changing color. A path gradient brush has a boundary path, a boundary color, a center point, and a center color. When you paint an area with a path gradient brush, the color changes gradually from the boundary color to the center color as you move from the boundary path to the center point.

 

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.

 

GdipCreatePathGradient

 

Description

Creates a PathGradientBrush object based on an array of points.

Syntax

GpStatus WINGDIPAPI GdipCreatePathGradient(

    GDIPCONST GpPointF* points,

    INT count,

    GpWrapMode wrapMode,

    GpPathGradient **polyGradient

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePathGradient ( _

    BYREF pPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL wrapMode AS LONG, _

    BYREF polyGradient AS DWORD _

) AS LONG

Parameters

 

points

[in] Pointer to an array of points that specifies the boundary path of the path gradient brush.

count

[in] Integer that specifies the number of elements in the points array.

wrapMode

[in] Element of the WrapMode enumeration that specifies how areas painted with the path gradient brush will be tiled. The default value is WrapModeClamp.

polyGradient

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

 

GdipCreatePathGradientFromPath

 

Description

Creates a PathGradientBrush object based on a GraphicsPath object.

Syntax

GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(

    GDIPCONST GpPath* path,

    GpPathGradient **polyGradient

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePathGradientFromPath ( _

    BYVAL path AS DWORD, _

    BYREF polyGradient AS DWORD _

) AS LONG

Parameters

 

path

[in] Pointer to a GraphicsPath object that specifies the boundary path of the path gradient brush.

polyGradient

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

 

GdipCreatePathGradientI

 

Description

Creates a PathGradientBrush object based on an array of points.

Syntax

GpStatus WINGDIPAPI GdipCreatePathGradientI(

    GDIPCONST GpPoint* points,

    INT count,

    GpWrapMode wrapMode,

    GpPathGradient **polyGradient

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreatePathGradientI ( _

    BYREF pPoints AS PointL, _

    BYVAL count AS LONG, _

    BYVAL wrapMode AS LONG, _

    BYREF polyGradient AS DWORD _

) AS LONG

Parameters

 

points

[in] Pointer to an array of points that specifies the boundary path of the path gradient brush.

count

[in] Integer that specifies the number of elements in the points array.

wrapMode

[in] Element of the WrapMode enumeration that specifies how areas painted with the path gradient brush will be tiled. The default value is WrapModeClamp.

polyGradient

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

 

GdipGetPathGradientBlend

 

Description

Gets the blend factors and the corresponding blend positions currently set for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientBlend(

    GpPathGradient *brush,

    REAL *blend,

    REAL *positions,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientBlend ( _

    BYVAL brush AS DWORD, _

    BYREF blend AS SINGLE, _

    BYREF positions AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

blend

[out] Pointer to an array that receives the blend factors.

positions

[out] Pointer to an array that receives the blend positions.

count

[in] Integer that specifies the number of blend factors to retrieve. Before calling the GdipGetPathGradientBlend function, call the GdipGetPathGradientBlendCount function to determine the current number of blend factors. The number of blend positions retrieved is the same as the number of blend factors retrieved.

Remarks

A PathGradientBrush object has a boundary path and a center point. When you fill an area with a path gradient brush, the color changes gradually as you move from the boundary path to the center point. By default, the color is linearly related to the distance, but you can customize the relationship between color and distance by calling the GdipSetPathGradientBlend method.

 

GdipGetPathGradientBlendCount

 

Description

Gets the number of blend factors currently set for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientBlendCount(

    GpPathGradient *brush,

    INT *count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientBlendCount ( _

    BYVAL brush AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

count

[out] Pointer to a variable that receives the number of blend factors currently set for this path gradient brush.

Remarks

Before you call the GdipGetPathGradientBlend function, you must allocate two buffers: one to receive an array of blend factors and one to receive an array of blend positions. To determine the size of the required buffers, call the GdipGetPathGradientBlendCount function. The size (in bytes) of each buffer should be the return value of GdipGetPathGradientBlendCount multiplied by sizeof(REAL) [4].

 

GdipGetPathGradientCenterColor

 

Description

Gets the color of the center point of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientCenterColor(

    GpPathGradient *brush,

    ARGB* colors

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientCenterColor ( _

    BYVAL brush AS DWORD, _

    BYREF colors AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

colors

[out] Pointer to a variable that receives the color of the center point.

Remarks

By default, the center point of a PathGradientBrush object is the centroid of the brush's boundary path, but you can set the center point to any location, inside or outside the path, by calling the GdipSetPathGradientCenterPoint or GdipSetPathGradientCenterPointI functions.

 

GdipGetPathGradientCenterPoint

 

Description

Gets the center point of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(

    GpPathGradient *brush,

    GpPointF* points

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientCenterPoint ( _

    BYVAL brush AS DWORD, _

    BYREF pPoints AS PointF _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

points

[out] Pointer to a PointF structure that receives the center point.

Remarks

By default, the center point of a PathGradientBrush object is at the centroid of the brush's boundary path, but you can set the center point to any location, inside or outside the path, by calling the GdipSetPathGradientCenterPoint function.

 

GdipGetPathGradientCenterPointI

 

Description

Gets the center point of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(

    GpPathGradient *brush,

    GpPoint* points

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientCenterPointI ( _

    BYVAL brush AS DWORD, _

    BYREF pPoints AS PointL _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

points

[out] Pointer to a PointL structure that receives the center point.

Remarks

By default, the center point of a PathGradientBrush object is at the centroid of the brush's boundary path, but you can set the center point to any location, inside or outside the path, by calling the GdipSetPathGradientCenterPointtI function.

 

GdipGetPathGradientFocusScales

 

Description

Gets the focus scales of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(

    GpPathGradient *brush,

    REAL* xScale,

    REAL* yScale

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientFocusScales ( _

    BYVAL brush AS DWORD, _

    BYREF xScale AS SINGLE, _

    BYREF yScale AS SINGLE _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

xScale

[out] Pointer to a variable that receives the x focus scale value.

yScale

[out] Pointer to a variable that receives the y focus scale value.

Remarks

By default, the center color of a path gradient is at the center point. By calling SetFocusScales, you can specify that the center color should appear along a path that surrounds the center point. For example, suppose the boundary path is a triangle and the center point is at the centroid of that triangle. Also assume that the boundary color is red and the center color is blue. If you set the focus scales to (0.2, 0.2), the color is blue along the boundary of a small triangle that surrounds the center point. That small triangle is the main boundary path scaled by a factor of 0.2 in the x direction and 0.2 in the y direction. When you paint with the path gradient brush, the color will change gradually from red to blue as you move from the boundary of the large triangle to the boundary of the small triangle. The area inside the small triangle will be filled with blue.

 

GdipGetPathGradientGammaCorrection

 

Description

Determines whether gamma correction is enabled for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(

    GpPathGradient *brush,

    BOOL *useGammaCorrection

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientGammaCorrection ( _

    BYVAL brush AS DWORD, _

    BYREF useGammaCorrection AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

useGammaCorrection

[out] Pointer to a variable that receives a boolean value that determines whether the gamma correction is enabled (TRUE) or not (FALSE).

 

GdipGetPathGradientPath

 

Description

Not implemented in Microsoft Windows GDI+ version 1.0.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientPath(

    GpPathGradient *brush,

    GpPath *path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientPath ( _

    BYVAL brush AS DWORD, _

    BYREF path AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to a variable thatg receives a pointer to the PathGradientBrush object.

path

[out] Pointer to the GraphicsPath object.

 

GdipGetPathGradientPointCount

 

Description

Gets the number of points in the array of points that defines this brush's boundary path.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientPointCount(

    GpPathGradient *brush,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientPointCount ( _

    BYVAL brush AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

count

[out] Pointer that receives the number of points in the array of points that defines this brush's boundary path.

 

GdipGetPathGradientPresetBlend

 

Description

Gets the preset colors and blend positions currently specified for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend(

    GpPathGradient *brush,

    ARGB *blend,

    REAL* positions,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientPresetBlend ( _

    BYVAL brush AS DWORD, _

    BYREF blend AS DWORD, _

    BYREF positions AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

blend

[out] Pointer to an array that receives the preset colors. A color of a given index in the blend array corresponds to the blend position of that same index in the positions array.

positions

[out] Pointer to an array that receives the blend positions. Each blend position is a number from 0 through 1, where 0 indicates the boundary of the gradient and 1 indicates the center point. A blend position between 0 and 1 indicates the set of all points that are a certain fraction of the distance from the boundary to the center point. For example, a blend position of 0.7 indicates the set of all points that are 70 percent of the way from the boundary to the center point.

count

[in] Long integer that specifies the number of elements in the blend colors array. This is the same as the number of elements in the positions array.

Remarks

A simple path gradient brush has two colors: a boundary color and a center color. When you paint with such a brush, the color changes gradually from the boundary color to the center color as you move from the boundary path to the center point. You can create a more complex gradient by specifying an array of preset colors and an array of blend positions.

 

Before you call the GdipGetPathGradientPresetBlend function, you must allocate two buffers: one to hold the array of preset colors and one to hold the array of blend positions. You can call the GdipGetPathGradientPresetBlendCount function to determine the required size of those buffers. The size of the color buffer is the return value of GdipGetPathGradientPresetBlendCount multiplied by sizeof(Color) [4]. The size of the position buffer is the value of GdipGetPathGradientPresetBlendCount multiplied by sizeof( REAL) [4].

 

GdipGetPathGradientPresetBlendCount

 

Description

Gets the number of preset colors currently specified for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount(

    GpPathGradient *brush,

    INT *count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientPresetBlendCount ( _

    BYVAL brush AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

count

[out] Pointer to a variable that receives the number of preset colors currently specified for this path gradient brush.

Remarks

A simple path gradient brush has two colors: a boundary color and a center color. When you paint with such a brush, the color changes gradually from the boundary color to the center color as you move from the boundary path to the center point. You can create a more complex gradient by specifying an array of preset colors and an array of blend positions.

 

You can obtain the interpolation colors and interpolation positions currently set for a PathGradientBrush object by calling the GdipGetPathGradientPresetBlend function. Before you call the GdipGetPathGradientPresetBlend function, you must allocate two buffers: one to hold the array of interpolation colors and one to hold the array of interpolation positions. You can call the GdipGetPathGradientPointCount function to determine the required size of those buffers. The size of the color buffer is the return value of GdipGetPathGradientPointCount multiplied by sizeof(Color) [4]. The size of the position buffer is the value of GdipGetPathGradientPointCount multiplied by sizeof( REAL) [4].

 

GdipGetPathGradientRect

 

Description

Gets the smallest rectangle that encloses the boundary path of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientRect(

    GpPathGradient *brush,

    GpRectF *rect

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientRect ( _

    BYVAL brush AS DWORD, _

    BYREF pRect AS RectF _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

rect

[out] Pointer to a RectF structure that receives the bounding rectangle.

 

GdipGetPathGradientRectI

 

Description

Gets the smallest rectangle that encloses the boundary path of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientRectI(

    GpPathGradient *brush,

    GpRect *rect

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientRectI ( _

    BYVAL brush AS DWORD, _

    BYREF pRect AS RectL _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

rect

[out] Pointer to a RectL structure that receives the bounding rectangle.

 

GdipGetPathGradientSurroundColorCount

 

Description

Gets the number of colors that have been specified for the boundary path of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(

    GpPathGradient *brush,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientSurroundColorCount ( _

    BYVAL brush AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

count

[out] Pointer to a variable thatg receives the number of colors that have been specified for the boundary path of this path gradient brush.

 

GdipGetPathGradientSurroundColorsWithCount

 

Description

Gets the surround colors currently specified for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(

    GpPathGradient *brush,

    ARGB* colors,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientSurroundColorsWithCount ( _

    BYVAL brush AS DWORD, _

    BYREF pColors AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

color

[in] Pointer to an array that receives the surround colors.

count

[in, out] Pointer to a long integer that, on input, specifies the number of colors requested. If the method succeeds, this parameter, on output, receives the number of colors retrieved. If the method fails, this parameter does not receive a value.

 

GdipGetPathGradientTransform

 

Description

Gets transformation matrix of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientTransform(

    GpPathGradient *brush,

    GpMatrix *matrix

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientTransform ( _

    BYVAL brush AS DWORD, _

    BYREF matrix AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

matrix

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

Remarks

A PathGradientBrush object maintains a transformation matrix that can store any affine transformation. When you use a path gradient brush to fill an area, GDI+ transforms the brush's boundary path according to the brush's transformation matrix and then fills the interior of the transformed path. The transformed path exists only during rendering; the boundary path stored in PathGradientBrush object is not transformed.

 

GdipGetPathGradientWrapMode

 

Description

Gets the wrap mode currently set for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(

    GpPathGradient *brush,

    GpWrapMode *wrapmode

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPathGradientWrapMode ( _

    BYVAL brush AS DWORD, _

    BYREF wrapMode AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

wrapMode

[out] Pointer to a variable that receives an element of the WrapMode enumeration that indicates the wrap mode currently set for this path gradient brush.

Remarks

The bounding rectangle of a path gradient brush is the smallest rectangle that encloses the brush's boundary path. When you paint the bounding rectangle with the path gradient brush, only the area inside the boundary path gets filled. The area inside the bounding rectangle but outside the boundary path does not get filled.

 

The default wrap mode for a path gradient brush is WrapModeClamp, which indicates that no painting occurs outside of the brush's bounding rectangle. All of the other wrap modes indicate that areas outside the brush's bounding rectangle will be tiled. Each tile is a copy (possibly flipped) of the filled path inside its bounding rectangle.

 

GdipMultiplyPathGradientTransform

 

Description

Updates the brush's transformation matrix with the product of itself and another matrix.

Syntax

GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform(

    GpPathGradient* brush,

    GDIPCONST GpMatrix *matrix,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipMultiplyPathGradientTransform ( _

    BYVAL brush AS DWORD, _

    BYVAL matrix AS DWORD, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

matrix

[in] Pointer to the matrix that will be multiplied by the brush's current transformation matrix.

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.

Remarks

A single 3 3 matrix can store any sequence of affine transformations. If you have several 3 3 matrices, each of which represents an affine transformation, the product of those matrices is a single 3 3 matrix that represents the entire sequence of transformations. The transformation represented by that product is called a composite transformation. For example, suppose matrix R represents a rotation and matrix T represents a translation. If matrix M is the product RT, then matrix M represents a composite transformation: first rotate, then translate.

 

The order of matrix multiplication is important. In general, the matrix product RT is not the same as the matrix product TR. In the example given in the previous paragraph, the composite transformation represented by RT (first rotate, then translate) is not the same as the composite transformation represented by TR (first translate, then rotate).

 

GdipResetPathGradientTransform

 

Description

Resets the transformation matrix of this path gradient brush to the identity matrix. This means that no transformation will take place.

Syntax

GpStatus WINGDIPAPI GdipResetPathGradientTransform(

    GpPathGradient* brush

);

PowerBASIC Syntax

DECLARE FUNCTION GdipResetPathGradientTransform ( _

    BYVAL brush AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

 

GdipRotatePathGradientTransform

 

Description

Updates this brush's current transformation matrix with the product of itself and a rotation matrix.

Syntax

GpStatus WINGDIPAPI GdipRotatePathGradientTransform(

    GpPathGradient* brush,

    REAL angle,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRotatePathGradientTransform ( _

    BYVAL brush AS DWORD, _

    BYVAL angle AS SINGLE, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush 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.

Remarks

A single 3 3 matrix can store any sequence of affine transformations. If you have several 3 3 matrices, each of which represents an affine transformation, the product of those matrices is a single 3 3 matrix that represents the entire sequence of transformations. The transformation represented by that product is called a composite transformation. For example, suppose matrix T represents a translation and matrix R represents a rotation. If matrix M is the product TR, then matrix M represents a composite transformation: first translate, then rotate.

 

GdipScalePathGradientTransform

 

Description

Updates this brush's current transformation matrix with the product of itself and a scaling matrix.

Syntax

GpStatus WINGDIPAPI GdipScalePathGradientTransform(

    GpPathGradient* brush,

    REAL sx,

    REAL sy,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipScalePathGradientTransform ( _

    BYVAL brush AS DWORD, _

    BYVAL sx AS SINGLE, _

    BYVAL sy AS SINGLE, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

sx

[in] Real number that specifies the horizontal scale factor.

sy

[in] Real number that specifies the vertical scale factor.

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.

Remarks

A single 3 3 matrix can store any sequence of affine transformations. If you have several 3 3 matrices, each of which represents an affine transformation, the product of those matrices is a single 3 3 matrix that represents the entire sequence of transformations. The transformation represented by that product is called a composite transformation. For example, suppose matrix T represents a translation and matrix S represents a scaling. If matrix M is the product TS, then matrix M represents a composite transformation: first translate, then scale.

 

GdipSetPathGradientBlend

 

Description

Sets the blend factors and the blend positions of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientBlend(

    GpPathGradient *brush,

    GDIPCONST REAL *blend,

    GDIPCONST REAL *positions,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientBlend ( _

    BYVAL brush AS DWORD, _

    BYREF blend AS SINGLE, _

    BYREF positions AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

blend

[in] Pointer to an array of blend factors. Each number in the array should be in the range 0 through 1.

positions

[in] Pointer to an array of blend positions. Each number in the array should be in the range 0 through 1.

count

[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.

Remarks

A PathGradientBrush object has a boundary path and a center point. When you fill an area with a path gradient brush, the color changes gradually as you move from the boundary path to the center point. By default, the color is linearly related to the distance, but you can customize the relationship between color and distance by calling the GdipSetPathGradientBlend method.

 

GdipSetPathGradientCenterColor

 

Description

Sets the center color of this path gradient brush. The center color is the color that appears at the brush's center point.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(

    GpPathGradient *brush,

    ARGB colors

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientCenterColor ( _

    BYVAL brush AS DWORD, _

    BYVAL colors AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

colors

[in] An ARGB color that specifies the center color.

Remarks

By default the center point is the centroid of the brush's boundary path, but you can set the center point to any location inside or outside the path.

 

GdipSetPathGradientCenterPoint

 

Description

Sets the center point of this path gradient brush. By default, the center point is at the centroid of the brush's boundary path, but you can set the center point to any location inside or outside the path.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(

    GpPathGradient *brush,

    GDIPCONST GpPointF* points

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientCenterPoint ( _

    BYVAL brush AS DWORD, _

    BYREF pPoints AS PointF _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

points

[in] Reference to a PointF structure that specifies the center point.

 

GdipSetPathGradientCenterPointI

 

Description

Sets the center point of this path gradient brush. By default, the center point is at the centroid of the brush's boundary path, but you can set the center point to any location inside or outside the path.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI(

    GpPathGradient *brush,

    GDIPCONST GpPoint* points

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientCenterPointI ( _

    BYVAL brush AS DWORD, _

    BYREF pPoints AS PointL _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

points

[in] Reference to a PointL object that specifies the center point.

 

GdipSetPathGradientFocusScales

 

Description

Sets the focus scales of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(

    GpPathGradient *brush,

    REAL xScale,

    REAL yScale

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientFocusScales ( _

    BYVAL brush AS DWORD, _

    BYVAL xScale AS SINGLE, _

    BYVAL yScale AS SINGLE _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

xScale

[in] Real number that specifies the x focus scale.

yScale

[in] Real number that specifies the y focus scale.

Remarks

By default, the center color of a path gradient is at the center point. By calling GdipSetGradientFocusScales, you can specify that the center color should appear along a path that surrounds the center point. That path is the boundary path scaled by a factor of xScale in the x direction and by a factor of yScale in the y direction. The area inside the scaled path is filled with the center color.

 

GdipSetPathGradientGammaCorrection

 

Description

Specifies whether gamma correction is enabled for this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection(

    GpPathGradient *brush,

    BOOL useGammaCorrection

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientGammaCorrection ( _

    BYVAL brush AS DWORD, _

    BYVAL useGammaCorrection AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

useGammaCorrection

[in] Boolean value that specifies whether gamma correction is enabled. TRUE specifies that gamma correction is enabled, and FALSE specifies that gamma correction is not enabled.

 

GdipSetPathGradientLinearBlend

 

Description

Sets the blend shape of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend(

    GpPathGradient *brush,

    REAL focus,

    REAL scale

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientLinearBlend ( _

    BYVAL brush AS DWORD, _

    BYVAL pFocus AS SINGLE, _

    BYVAL pScale AS SINGLE _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

focus

[in] Real number that specifies where the center color will be at its highest intensity. This number must be in the range 0 through 1.

scale

[in] Real number that specifies the maximum intensity of center color that gets blended with the boundary color. This number must be in the range 0 through 1. The default value is 1.

Remarks

By default, as you move from the boundary of a path gradient to the center point, the color changes gradually from the boundary color to the center color. You can customize the positioning and blending of the boundary and center colors by calling the SetBlendTriangularShape method.

 

GdipSetPathGradientPath

 

Description

Not implemented in Microsoft Windows GDI+ version 1.0.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientPath(

    GpPathGradient *brush,

    GDIPCONST GpPath *path

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientPath ( _

    BYVAL brush AS DWORD, _

    BYVAL path AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

path

[in] Pointer to the GraphicsPath object.

 

GdipSetPathGradientPresetBlend

 

Description

Sets the preset colors and the blend positions of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(

    GpPathGradient *brush,

    GDIPCONST ARGB *blend,

    GDIPCONST REAL* positions,

    INT count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientPresetBlend ( _

    BYVAL brush AS DWORD, _

    BYREF Blend AS DWORD, _

    BYREF Positions AS SINGLE, _

    BYVAL count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

blend

[in] Pointer to an array of ARGB colors that specifies the interpolation colors for the gradient. A color of a given index in the blend array corresponds to the blend position of that same index in the positions array.

positions

[in] Pointer to an array that specifies the blend positions. Each blend position is a number from 0 through 1, where 0 indicates the boundary of the gradient and 1 indicates the center point. A blend position between 0 and 1 specifies the set of all points that are a certain fraction of the distance from the boundary to the center point. For example, a blend position of 0.7 specifies the set of all points that are 70 percent of the way from the boundary to the center point.

count

[in] Integer that specifies the number of Color objects in the blend array. This is the same as the number of elements in the positions array.

Remarks

A simple path gradient brush has two colors: a boundary color and a center color. When you paint with such a brush, the color changes gradually from the boundary color to the center color as you move from the boundary path to the center point. You can create a more complex gradient by specifying an array of preset colors and an array of blend positions.

 

GdipSetPathGradientSigmaBlend

 

Description

Sets the blend shape of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(

    GpPathGradient *brush,

    REAL focus,

    REAL scale

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientSigmaBlend ( _

    BYVAL brush AS DWORD, _

    BYVAL pFocus AS SINGLE, _

    BYVAL pScale AS SINGLE _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

focus

[in] Single precision value that specifies where the center color will be at its highest intensity. This number must be in the range 0 through 1.

scale

[in] Single precision value that specifies the maximum intensity of center color that gets blended with the boundary color. This number must be in the range 0 through 1. The default value is 1.

Remarks

By default, as you move from the boundary of a path gradient to the center point, the color changes gradually from the boundary color to the center color. You can customize the positioning and blending of the boundary and center colors by calling the GdipSetPathGradientSigmaBlend method.

 

GdipSetPathGradientSurroundColorsWithCount

 

Description

Sets the surround colors of this path gradient brush. The surround colors are colors specified for discrete points on the brush's boundary path.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(

    GpPathGradient *brush,

    GDIPCONST ARGB* colors,

    INT* count

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientSurroundColorsWithCount ( _

    BYVAL brush AS DWORD, _

    BYREF pColors AS DWORD, _

    BYREF count AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

colors

[in] Pointer to an array of ARGB colors that specify the surround colors.

count

[in, out] Pointer to a long integer that, on input, specifies the number of Color objects in the colors array. If the method succeeds, this parameter, on output, receives the number of surround colors set. If the method fails, this parameter does not receive a value.

Remarks

A path gradient brush has a boundary path and a center point. The center point is set to a single color, but you can specify different colors for several points on the boundary. For example, suppose you specify red for the center color, and you specify blue, green, and yellow for distinct points on the boundary. Then as you move along the boundary, the color will change gradually from blue to green to yellow and back to blue. As you move along a straight line from any point on the boundary to the center point, the color will change from that boundary point's color to red.

 

GdipSetPathGradientTransform

 

Description

Sets the transformation matrix of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientTransform(

    GpPathGradient *brush,

    GpMatrix *matrix

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientTransform ( _

    BYVAL brush AS DWORD, _

    BYVAL matrix AS DWORD _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

matrix

[in] Pointer to a variable that specifies the transformation matrix.

Remarks

A PathGradientBrush  object has a GraphicsPath object that serves as the boundary path for the brush. When you paint with a path gradient brush, only the area inside the boundary path is filled. If the brush's transformation matrix is set to represent any transformation other than the identity, then the boundary path is transformed according to that matrix during rendering, and only the area inside the transformed path is filled.

 

GdipSetPathGradientWrapMode

 

Description

Sets the wrap mode of this path gradient brush.

Syntax

GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(

    GpPathGradient *brush,

    GpWrapMode wrapmode

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetPathGradientWrapMode ( _

    BYVAL brush AS DWORD, _

    BYVAL wrapMode AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush object.

wrapMode

[in] Element of the WrapMode enumeration that specifies how areas painted with the path gradient brush will be tiled. The default value is WrapModeClamp.

Remarks

The bounding rectangle of a path gradient brush is the smallest rectangle that encloses the brush's boundary path. When you paint the bounding rectangle with the path gradient brush, only the area inside the boundary path gets filled. The area inside the bounding rectangle but outside the boundary path does not get filled.

 

WrapModeClamp (the default wrap mode) indicates that no painting occurs outside of the brush's bounding rectangle. All of the other wrap modes indicate that areas outside the brush's bounding rectangle will be tiled. Each tile is a copy (possibly flipped) of the filled path inside its bounding rectangle.

 

GdipTranslatePathGradientTransform

 

Description

Updates this brush's current transformation matrix with the product of itself and a translation matrix.

Syntax

GpStatus WINGDIPAPI GdipTranslatePathGradientTransform(

    GpPathGradient* brush,

    REAL dx,

    REAL dy,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipTranslatePathGradientTransform ( _

    BYVAL brush AS DWORD, _

    BYVAL dx AS SINGLE, _

    BYVAL dy AS SINGLE, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

brush

[in] Pointer to the PathGradientBrush 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.

Remarks

A single 3 3 matrix can store any sequence of affine transformations. If you have several 3 3 matrices, each of which represents an affine transformation, the product of those matrices is a single 3 3 matrix that represents the entire sequence of transformations. The transformation represented by that product is called a composite transformation. For example, suppose matrix S represents a scaling and matrix T represents a translation. If matrix M is the product ST, then matrix M represents a composite transformation: first scale, then translate.

 

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