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
ColorThe start color of the gradient brush.
endColor
ColorThe 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
ColorThe start color of the gradient brush.
endColor
ColorThe end color of the gradient brush.
startX
intThe X-coordinate of the starting point of the gradient brush.
startY
intThe Y-coordinate of the starting point of the gradient brush.
endX
intThe X-coordinate of the ending point of the gradient brush.
endY
intThe 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
EndX
Gets or sets the X-coordinate of the ending point of the gradient brush.
public int EndX
Field Value
EndY
Gets or sets the Y-coordinate of the ending point of the gradient brush.
public int EndY
Field Value
MappingMode
Gets or sets the mapping mode of the gradient brush.
public BrushMappingMode MappingMode
Field Value
RelativeBoundingBoxSize
The size of the bounding box used in the relative mapping mode.
public const int RelativeBoundingBoxSize = 1000
Field Value
StartColor
Gets or sets the start color of the gradient brush.
public Color StartColor
Field Value
StartX
Gets or sets the X-coordinate of the starting point of the gradient brush.
public int StartX
Field Value
StartY
Gets or sets the Y-coordinate of the starting point of the gradient brush.
public int StartY
Field Value
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
BitmapThe bitmap on which to draw the rectangle.
pen
PenThe pen to use for the rectangle's outline, or null for no outline.
x
intThe x-coordinate of the top-left corner of the rectangle.
y
intThe y-coordinate of the top-left corner of the rectangle.
width
intThe width of the rectangle.
height
intThe height of the rectangle.