Class PathGradientBrush
Namespace: Aspose.Imaging.Brushes
Assembly: Aspose.Imaging.dll (25.2.0)
封装了一个带有渐变的 Aspose.Imaging.Brush 对象。此类不能被继承。
[JsonObject(MemberSerialization.OptIn)]
public sealed class PathGradientBrush : PathGradientBrushBase, IDisposable
继承
object ← DisposableObject ← Brush ← TransformBrush ← PathGradientBrushBase ← PathGradientBrush
实现
继承成员
PathGradientBrushBase.PathPoints, PathGradientBrushBase.GraphicsPath, PathGradientBrushBase.CenterPoint, PathGradientBrushBase.FocusScales, TransformBrush.ResetTransform(), TransformBrush.MultiplyTransform(Matrix), TransformBrush.MultiplyTransform(Matrix, MatrixOrder), TransformBrush.TranslateTransform(float, float), TransformBrush.TranslateTransform(float, float, MatrixOrder), TransformBrush.ScaleTransform(float, float), TransformBrush.ScaleTransform(float, float, MatrixOrder), TransformBrush.RotateTransform(float), TransformBrush.RotateTransform(float, MatrixOrder), TransformBrush.WrapMode, TransformBrush.Transform, TransformBrush.IsTransformChanged, Brush.DeepClone(), Brush.Equals(object), Brush.GetHashCode(), Brush.Opacity, DisposableObject.Dispose(), DisposableObject.Disposed, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
备注
中心颜色默认为白色。用户可以在任何时候更改此值。
环绕颜色数组默认初始化为包含白色的单个元素。环绕颜色可以在后续更改,但设置环绕颜色时至少需要一个元素。
有关其初始化的更多详细信息,请参见 Aspose.Imaging.Brushes.PathGradientBrush.Blend。
构造函数
PathGradientBrush(PointF[])
使用指定的点初始化 Aspose.Imaging.Brushes.PathGradientBrush 类的新实例。
public PathGradientBrush(PointF[] pathPoints)
参数
pathPoints
PointF[]
一个 Aspose.Imaging.PointF 结构的数组,表示构成路径顶点的点。
PathGradientBrush(PointF[], WrapMode)
使用指定的点和包裹模式初始化 Aspose.Imaging.Brushes.PathGradientBrush 类的新实例。
public PathGradientBrush(PointF[] pathPoints, WrapMode wrapMode)
参数
pathPoints
PointF[]
一个 Aspose.Imaging.PointF 结构的数组,表示构成路径顶点的点。
wrapMode
WrapMode
一个 Aspose.Imaging.WrapMode,指定如何平铺使用此 Aspose.Imaging.Brushes.PathGradientBrush 绘制的填充。
PathGradientBrush(Point[])
使用指定的点初始化 Aspose.Imaging.Brushes.PathGradientBrush 类的新实例。
public PathGradientBrush(Point[] pathPoints)
参数
pathPoints
Point[]
一个 Aspose.Imaging.Point 结构的数组,表示构成路径顶点的点。
PathGradientBrush(Point[], WrapMode)
使用指定的点和包裹模式初始化 Aspose.Imaging.Brushes.PathGradientBrush 类的新实例。
public PathGradientBrush(Point[] pathPoints, WrapMode wrapMode)
参数
pathPoints
Point[]
一个 Aspose.Imaging.Point 结构的数组,表示构成路径顶点的点。
wrapMode
WrapMode
一个 Aspose.Imaging.WrapMode,指定如何平铺使用此 Aspose.Imaging.Brushes.PathGradientBrush 绘制的填充。
PathGradientBrush(GraphicsPath)
使用指定路径初始化 Aspose.Imaging.Brushes.PathGradientBrush 类的新实例。
public PathGradientBrush(GraphicsPath path)
参数
path
GraphicsPath
定义此 Aspose.Imaging.Brushes.PathGradientBrush 填充区域的 Aspose.Imaging.GraphicsPath。
属性
Blend
获取或设置一个 Aspose.Imaging.Blend,指定定义渐变的自定义衰减的位置信息和因子。
public Blend Blend { get; set; }
属性值
CenterColor
获取或设置路径渐变中心的颜色。
public Color CenterColor { get; set; }
属性值
InterpolationColors
获取或设置一个 Aspose.Imaging.ColorBlend,定义一个多色线性渐变。
[Obsolete("此属性不再在此类中使用。请改用 PathMulticolorGradientBrush 类。")]
[JsonIgnore]
public ColorBlend InterpolationColors { get; set; }
属性值
SurroundColors
获取或设置一个颜色数组,对应于此 Aspose.Imaging.Brushes.PathGradientBrush 填充的路径中的点。
public Color[] SurroundColors { get; set; }
属性值
Color[]
方法
SetBlendTriangularShape(float)
创建一个具有中心颜色和线性衰减到一个周围颜色的渐变。
public void SetBlendTriangularShape(float focus)
参数
focus
float
一个从 0 到 1 的值,指定沿从路径中心到路径边界的任何径向,中心颜色的最高强度位置。值为 1(默认值)将最高强度放在路径的中心。
SetBlendTriangularShape(float, float)
创建一个具有中心颜色和线性衰减到每个周围颜色的渐变。
public void SetBlendTriangularShape(float focus, float scale)
参数
focus
float
一个从 0 到 1 的值,指定沿从路径中心到路径边界的任何径向,中心颜色的最高强度位置。值为 1(默认值)将最高强度放在路径的中心。
scale
float
一个从 0 到 1 的值,指定与边界颜色混合的中心颜色的最大强度。值为 1 会导致中心颜色的最高强度,这是默认值。
SetSigmaBellShape(float)
创建一个渐变画笔,从路径中心向外改变颜色,直到路径边界。颜色之间的过渡基于钟形曲线。
public void SetSigmaBellShape(float focus)
参数
focus
float
一个从 0 到 1 的值,指定沿从路径中心到路径边界的任何径向,中心颜色的最高强度位置。值为 1(默认值)将最高强度放在路径的中心。
SetSigmaBellShape(float, float)
创建一个渐变画笔,从路径中心向外改变颜色,直到路径边界。颜色之间的过渡基于钟形曲线。
public void SetSigmaBellShape(float focus, float scale)
参数
focus
float
一个从 0 到 1 的值,指定沿从路径中心到路径边界的任何径向,中心颜色的最高强度位置。值为 1(默认值)将最高强度放在路径的中心。
scale
float
一个从 0 到 1 的值,指定与边界颜色混合的中心颜色的最大强度。值为 1 会导致中心颜色的最高强度,这是默认值。