Table of Contents

Method FillGradient

Namespace
Alternet.Skia
Assembly
Alternet.UI.Common.dll

FillGradient(SKCanvas, SKRect, SKColor, SKColor, SKPoint, SKPoint)

Fills the specified rectangular area on the canvas with a linear gradient.

public static void FillGradient(SKCanvas canvas, SKRect rect, SKColor beginColor, SKColor endColor, SKPoint point1, SKPoint point2)

Parameters

canvas SKCanvas

The SKCanvas on which the gradient will be drawn. Cannot be null.

rect SKRect

The rectangular area to fill, specified as a SKRect. If the width or height is less than or equal to zero, the method does nothing.

beginColor SKColor

The starting color of the gradient.

endColor SKColor

The ending color of the gradient.

point1 SKPoint

The starting point of the gradient, specified as a SKPoint.

point2 SKPoint

The ending point of the gradient, specified as a SKPoint. If this point coincides with point1, the method falls back to a solid fill using beginColor.

Remarks

This method creates a linear gradient between point1 and point2 and fills the specified rectangle with it. If the gradient points are identical, the rectangle is filled with a solid color instead.