Graphics.Brush

From Xojo Documentation

Property (As GraphicsBrush )
aGraphics.Brush = newGraphicsBrushValue
or
GraphicsBrushValue = aGraphics.Brush

New in 2020r2

Supported for all project types and targets.

The brush to be used when drawing.

Sample Code

This code in the Paint event, draws an oval with a linear gradient:

Var linearBrush As New LinearGradientBrush
linearBrush.StartPoint = New Point(0, 0)
linearBrush.EndPoint = New Point(g.Width, g.Height)
linearBrush.GradientStops.Add(New Pair(0, Color.Red))
linearBrush.GradientStops.Add(New Pair(0.4, Color.Yellow))
linearBrush.GradientStops.Add(New Pair(0.7, Color.Magenta))
linearBrush.GradientStops.Add(New Pair(1.0, Color.Blue))

g.Brush = linearBrush
g.FillOval(0, 0, g.Width, g.Height)

Compatibility

Desktop and iOS project types on all supported operating systems.

See Also

LinearGradientBrush, PictureBrush, and RadialGradientBrush classes.