PathGradientBrush
Namespace: System.Drawing.Drawing2D
Assembly: System.Drawing.Managed (4.0.0.0)
Encapsulates a Brush object that fills the interior of a GraphicsPath object with a gradient. This class cannot be inherited.
- C#
- VB.NET
public class PathGradientBrush : Brush
Public Class PathGradientBrush
Inherits Brush
Constructors
PathGradientBrush(points)
Initializes a new instance of the PathGradientBrush class with the specified points.
| Name | Type | Description |
|---|---|---|
| points | PointF[] | An array of PointF structures that represents the points that make up the vertices of the path. |
PathGradientBrush(points)
Initializes a new instance of the PathGradientBrush class with the specified points.
| Name | Type | Description |
|---|---|---|
| points | Point[] | An array of Point structures that represents the points that make up the vertices of the path. |
PathGradientBrush(points, wrapMode)
Initializes a new instance of the PathGradientBrush class with the specified wrap mode.
| Name | Type | Description |
|---|---|---|
| points | PointF[] | An array of PointF structures that represents the points that make up the vertices of the path. |
| wrapMode | WrapMode | A WrapMode that specifies how fills drawn with this PathGradientBrush are tiled. |
PathGradientBrush(points, wrapMode)
Initializes a new instance of the PathGradientBrush class with the specified wrap mode.
| Name | Type | Description |
|---|---|---|
| points | Point[] | An array of Point structures that represents the points that make up the vertices of the path. |
| wrapMode | WrapMode | A WrapMode that specifies how fills drawn with this PathGradientBrush are tiled. |
PathGradientBrush(path)
Initializes a new instance of the PathGradientBrush class with the specified path.
| Name | Type | Description |
|---|---|---|
| path | GraphicsPath | The GraphicsPath that defines the area filled by this PathGradientBrush. |
Properties
Blend
Blend: Gets or sets a Blend that specifies positions and factors that define a custom falloff for the gradient.
CenterColor
Color: Gets or sets the color at the center of the path gradient.
CenterPoint
PointF: Gets or sets the center point of the path gradient.
FocusScales
PointF: Gets or sets the focus point for the gradient falloff.
InterpolationColors
ColorBlend: Gets or sets a ColorBlend that defines a multicolor linear gradient.
Rectangle
RectangleF: Gets a bounding rectangle for this PathGradientBrush.
SurroundColors
Color[]: Gets or sets an array of colors that correspond to the points in the path this PathGradientBrush fills.
Transform
Matrix: Gets or sets a copy Matrix that defines a local geometric transform for this PathGradientBrush.
WrapMode
WrapMode: Gets or sets a WrapMode enumeration that indicates the wrap mode for this PathGradientBrush.
Methods
Clone()
Creates an exact copy of this PathGradientBrush.
Returns: Object. The PathGradientBrush this method creates, cast as an object.
MultiplyTransform(matrix)
Multiplies the Matrix object that represents the local geometric transformation of this PathGradientBrush object by the specified Matrix object by prepending the specified Matrix object.
| Parameter | Type | Description |
|---|---|---|
| matrix | Matrix | The Matrix object by which to multiply the geometric transformation. |
MultiplyTransform(matrix, order)
Multiplies the Matrix object that represents the local geometric transformation of this PathGradientBrush object by the specified Matrix object in the specified order.
| Parameter | Type | Description |
|---|---|---|
| matrix | Matrix | The Matrix object by which to multiply the geometric transformation. |
| order | MatrixOrder | A MatrixOrder enumeration that specifies the order in which to multiply the two matrices. |
ResetTransform()
Resets the property of this PathGradientBrush object to identity.
RotateTransform(angle)
Rotates the local geometric transformation of this PathGradientBrush object by the specified amount. This method prepends the rotation to the transformation.
| Parameter | Type | Description |
|---|---|---|
| angle | Single | The angle of rotation. |
RotateTransform(angle, order)
Rotates the local geometric transformation of this PathGradientBrush object by the specified amount in the specified order.
| Parameter | Type | Description |
|---|---|---|
| angle | Single | The angle of rotation. |
| order | MatrixOrder | A MatrixOrder enumeration that specifies whether to append or prepend the rotation matrix. |
ScaleTransform(sx, sy)
Scales the local geometric transformation of this PathGradientBrush object by the specified amounts. This method prepends the scaling matrix to the transformation.
| Parameter | Type | Description |
|---|---|---|
| sx | Single | The amount by which to scale the transformation in the x direction. |
| sy | Single | The amount by which to scale the transformation in the y direction. |
ScaleTransform(sx, sy, order)
Scales the local geometric transformation of this PathGradientBrush object by the specified amounts in the specified order.
| Parameter | Type | Description |
|---|---|---|
| sx | Single | The amount by which to scale the transformation in the x direction. |
| sy | Single | The amount by which to scale the transformation in the y direction. |
| order | MatrixOrder | A MatrixOrder enumeration that specifies whether to append or prepend the scaling matrix. |
SetBlendTriangularShape(focus)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
| Parameter | Type | Description |
|---|---|---|
| focus | Single | A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color). |
SetBlendTriangularShape(focus, scale)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
| Parameter | Type | Description |
|---|---|---|
| focus | Single | A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color). |
| scale | Single | A value from 0 through1 that specifies how fast the colors falloff from the starting color to focus (ending color) |
SetSigmaBellShape(focus)
Creates a gradient falloff based on a bell-shaped curve.
| Parameter | Type | Description |
|---|---|---|
| focus | Single | A value from 0 through 1 that specifies the center of the gradient (the point where the starting color and ending color are blended equally). |
SetSigmaBellShape(focus, scale)
Creates a gradient falloff based on a bell-shaped curve.
| Parameter | Type | Description |
|---|---|---|
| focus | Single | A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color). |
| scale | Single | A value from 0 through 1 that specifies how fast the colors falloff from the focus . |
TranslateTransform(dx, dy)
Translates the local geometric transformation of this PathGradientBrush object by the specified dimensions. This method prepends the translation to the transformation.
| Parameter | Type | Description |
|---|---|---|
| dx | Single | The dimension by which to translate the transformation in the x direction. |
| dy | Single | The dimension by which to translate the transformation in the y direction. |
TranslateTransform(dx, dy, order)
Translates the local geometric transformation of this PathGradientBrush object by the specified dimensions in the specified order.
| Parameter | Type | Description |
|---|---|---|
| dx | Single | The dimension by which to translate the transformation in the x direction. |
| dy | Single | The dimension by which to translate the transformation in the y direction. |
| order | MatrixOrder | The order (prepend or append) in which to apply the translation. |