Table of Contents

Class LinearGradientBrush

Namespace
nanoFramework.Presentation.Media
Assembly
nanoFramework.Graphics.dll

Represents a linear gradient brush, which fills a shape with a gradient color that varies in a linear fashion between a start color and an end color.

public sealed class LinearGradientBrush : Brush
Inheritance
LinearGradientBrush
Inherited Members
Extension Methods

Constructors

LinearGradientBrush(Color, Color)

Initializes a new instance of the LinearGradientBrush class with the specified start and end colors.

public LinearGradientBrush(Color startColor, Color endColor)

Parameters

startColor Color

The start color of the gradient brush.

endColor Color

The end color of the gradient brush.

LinearGradientBrush(Color, Color, int, int, int, int)

Initializes a new instance of the LinearGradientBrush class with the specified start and end colors and starting and ending points.

public LinearGradientBrush(Color startColor, Color endColor, int startX, int startY, int endX, int endY)

Parameters

startColor Color

The start color of the gradient brush.

endColor Color

The end color of the gradient brush.

startX int

The X-coordinate of the starting point of the gradient brush.

startY int

The Y-coordinate of the starting point of the gradient brush.

endX int

The X-coordinate of the ending point of the gradient brush.

endY int

The Y-coordinate of the ending point of the gradient brush.

Fields

EndColor

Gets or sets the end color of the gradient brush.

public Color EndColor

Field Value

Color

EndX

Gets or sets the X-coordinate of the ending point of the gradient brush.

public int EndX

Field Value

int

EndY

Gets or sets the Y-coordinate of the ending point of the gradient brush.

public int EndY

Field Value

int

MappingMode

Gets or sets the mapping mode of the gradient brush.

public BrushMappingMode MappingMode

Field Value

BrushMappingMode

RelativeBoundingBoxSize

The size of the bounding box used in the relative mapping mode.

public const int RelativeBoundingBoxSize = 1000

Field Value

int

StartColor

Gets or sets the start color of the gradient brush.

public Color StartColor

Field Value

Color

StartX

Gets or sets the X-coordinate of the starting point of the gradient brush.

public int StartX

Field Value

int

StartY

Gets or sets the Y-coordinate of the starting point of the gradient brush.

public int StartY

Field Value

int

Methods

RenderRectangle(Bitmap, Pen, int, int, int, int)

Renders a rectangle using the current brush and pen.

protected override void RenderRectangle(Bitmap bmp, Pen pen, int x, int y, int width, int height)

Parameters

bmp Bitmap

The bitmap on which to draw the rectangle.

pen Pen

The pen to use for the rectangle's outline, or null for no outline.

x int

The x-coordinate of the top-left corner of the rectangle.

y int

The y-coordinate of the top-left corner of the rectangle.

width int

The width of the rectangle.

height int

The height of the rectangle.