public static Brush CreateLinearGradient(
PointF startPoint,
PointF endPoint,
ColorF startColor,
ColorF endColor,
GradientWrapMode wrapMode = GradientWrapMode.Stop,
WorkingColorSpace workingColorSpace = WorkingColorSpace.Default
)Public Shared Function CreateLinearGradient (
startPoint As PointF,
endPoint As PointF,
startColor As ColorF,
endColor As ColorF,
Optional wrapMode As GradientWrapMode = GradientWrapMode.Stop,
Optional workingColorSpace As WorkingColorSpace = WorkingColorSpace.Default
) As Brushpublic:
static Brush^ CreateLinearGradient(
PointF startPoint,
PointF endPoint,
ColorF startColor,
ColorF endColor,
GradientWrapMode wrapMode = GradientWrapMode::Stop,
WorkingColorSpace workingColorSpace = WorkingColorSpace::Default
)static member CreateLinearGradient :
startPoint : PointF *
endPoint : PointF *
startColor : ColorF *
endColor : ColorF *
?wrapMode : GradientWrapMode *
?workingColorSpace : WorkingColorSpace
(* Defaults:
let _wrapMode = defaultArg wrapMode GradientWrapMode.Stop
let _workingColorSpace = defaultArg workingColorSpace WorkingColorSpace.Default
*)
-> Brush This overload creates a gradient with fix coordinates. To automatically apply the gradient to the bounds of each Path, use the overloads with an angle parameter, such as the CreateLinearGradient(Single, Color32, Color32, WorkingColorSpace) overload.
The workingColorSpace parameter affects only the color interpolation, not the blending with the background, which is determined by the color space of the target bitmap data (or by DrawingOptions.Quantizer, if specified).
In this overload the default value of workingColorSpace maps to WorkingColorSpace.Linear, because the ColorF type represents a color in the linear color space. When creating a monochromatic gradient, specifying Srgb can be better, because then the perceived mid-tone brightness will be at the middle of the gradient. Otherwise, using Linear may be more appropriate, so the transition between the colors will seem more "natural".