public static Brush CreateLinearGradient(
float angle,
Color64 startColor,
Color64 endColor,
WorkingColorSpace workingColorSpace = WorkingColorSpace.Default
)Public Shared Function CreateLinearGradient (
angle As Single,
startColor As Color64,
endColor As Color64,
Optional workingColorSpace As WorkingColorSpace = WorkingColorSpace.Default
) As Brushpublic:
static Brush^ CreateLinearGradient(
float angle,
Color64 startColor,
Color64 endColor,
WorkingColorSpace workingColorSpace = WorkingColorSpace::Default
)static member CreateLinearGradient :
angle : float32 *
startColor : Color64 *
endColor : Color64 *
?workingColorSpace : WorkingColorSpace
(* Defaults:
let _workingColorSpace = defaultArg workingColorSpace WorkingColorSpace.Default
*)
-> Brush This overload creates a gradient with dynamic coordinates, applying the gradient automatically to the bounds of each Path. To use fix coordinates instead, use the overloads with a startPoint and endPoint parameters, such as the CreateLinearGradient(PointF, PointF, Color32, Color32, GradientWrapMode, 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.Srgb, because the Color32 type represents a color in the sRGB 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".