Method DrawFilledQuadrilateral
DrawFilledQuadrilateral(Quadrilateral, Color32, Color32, double)
Fills the interior of the specified quadrilateral and then draws its outline, using a solid fill color and a solid stroke color with the given thickness.
public Canvas DrawFilledQuadrilateral(Quadrilateral quad, Color32 fillColor, Color32 strokeColor, double strokeThickness = 1)
Parameters
quadQuadrilateralThe four-cornered polygon to fill and outline.
fillColorColor32The interior fill color.
strokeColorColor32The outline stroke color.
strokeThicknessdoubleThe stroke thickness in pixels. Must be greater than zero. Defaults to 1.
Returns
Examples
var quad = new Quadrilateral(
new Point(50, 10), new Point(250, 10),
new Point(280, 110), new Point(20, 110));
var canvas = new Canvas(image);
canvas.DrawFilledQuadrilateral(
quad,
fillColor: new Color32(200, 255, 200),
strokeColor: new Color32(0, 100, 0),
strokeThickness: 2);
Exceptions
- ArgumentNullException
Thrown if
quadis null.- ArgumentOutOfRangeException
Thrown if
strokeThicknessis less than or equal to zero.
DrawFilledQuadrilateral(Quadrilateral, Brush, Pen)
Fills the interior of the specified quadrilateral and then draws its outline, using the given brush and pen.
public Canvas DrawFilledQuadrilateral(Quadrilateral quad, Brush brush, Pen pen)
Parameters
quadQuadrilateralThe four-cornered polygon to fill and outline.
brushBrushThe brush that defines the fill color.
penPenThe pen that defines the stroke color, thickness, line join, line cap, miter limit, and alignment.
Returns
Examples
var quad = new Quadrilateral(
new Point(50, 10), new Point(250, 10),
new Point(280, 110), new Point(20, 110));
var brush = new Brush(new Color32(200, 255, 200));
var pen = new Pen(new Color32(0, 100, 0), 2)
{
LineJoin = LineJoin.Bevel,
Alignment = PenAlignment.Outside
};
var canvas = new Canvas(image);
canvas.DrawFilledQuadrilateral(quad, brush, pen);
Exceptions
- ArgumentNullException
Thrown if
quad,brush, orpenis null.