Type Default Value Read Only Static Description
ShapeDrawingType DrawingType.Both No No The drawing type for shapes.
Notes

When drawing a shape, this property indicates if the shape should be outlined only, or filled only or both.

See Also

ShapeDrawingType

Example

The following code draws an outline of a rectangle, then paints another rectangle within it and finally paints and outlines another rectangle within that.

[C#]Canvas canvas = new Canvas(180, 180);
DrawOptions drawOpts = new DrawOptions();
drawOpts.PenColor.Color = Color.Black;
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Draw;
canvas.DrawRect(new XRect(20, 20, 160, 160), drawOpts);
drawOpts.PaintColor.Color = Color.Plum;
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Paint;
canvas.DrawRect(new XRect(40, 40, 120, 120), drawOpts);
drawOpts.PenColor.Color = Color.Red;
drawOpts.PaintColor.Color = Color.DarkOrchid;
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Both;
canvas.DrawRect(new XRect(60, 60, 80, 80), drawOpts);
canvas.SaveAs(Server.MapPath("DrawOptions_ShapeDrawing_74.png"));


[Visual Basic]Dim canvas As New Canvas(180, 180)
Dim drawOpts As New DrawOptions()
drawOpts.PenColor.Color = Color.Black
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Draw
canvas.DrawRect(New XRect(20, 20, 160, 160), drawOpts)
drawOpts.PaintColor.Color = Color.Plum
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Paint
canvas.DrawRect(New XRect(40, 40, 120, 120), drawOpts)
drawOpts.PenColor.Color = Color.Red
drawOpts.PaintColor.Color = Color.DarkOrchid
drawOpts.ShapeDrawing = DrawOptions.ShapeDrawingType.Both
canvas.DrawRect(New XRect(60, 60, 80, 80), drawOpts)
canvas.SaveAs(Server.MapPath("DrawOptions_ShapeDrawing_74.png"))



DrawOptions_ShapeDrawing_74.png