DrawRectangle(IImmutableBrush, ImmutablePen, Rect, Double, Double, BoxShadows) Method
Draws a rectangle with the specified Brush and Pen.
Definition
Namespace: Avalonia.Media
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public void DrawRectangle(
IImmutableBrush? brush,
ImmutablePen? pen,
Rect rect,
double radiusX = 0,
double radiusY = 0,
BoxShadows boxShadows = default
)
Public Sub DrawRectangle (
brush As IImmutableBrush,
pen As ImmutablePen,
rect As Rect,
Optional radiusX As Double = 0,
Optional radiusY As Double = 0,
Optional boxShadows As BoxShadows = Nothing
)
member DrawRectangle :
brush : IImmutableBrush *
pen : ImmutablePen *
rect : Rect *
?radiusX : float *
?radiusY : float *
?boxShadows : BoxShadows
(* Defaults:
let _radiusX = defaultArg radiusX 0
let _radiusY = defaultArg radiusY 0
let _boxShadows = defaultArg boxShadows new BoxShadows()
*)
-> unit
Parameters
- IImmutableBrush
- The brush used to fill the rectangle, or
null
for no fill. - ImmutablePen
- The pen used to stroke the rectangle, or
null
for no stroke. - Rect
- The rectangle bounds.
- Double (Optional)
- The radius in the X dimension of the rounded corners. This value will be clamped to the range of 0 to Width/2
- Double (Optional)
- The radius in the Y dimension of the rounded corners. This value will be clamped to the range of 0 to Height/2
- BoxShadows (Optional)
- Box shadow effect parameters
Remarks
The brush and the pen can both be null. If the brush is null, then no fill is performed. If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible.
See Also
Reference
ImmediateDrawingContext Class
DrawRectangle Overload
Avalonia.Media Namespace