Type Default Value Read Only Static Description
XColor Black No No The pen color.
Notes

This property reflects the pen color used when outlining an object such as a shape or text.

See Also

PaintColor

XColor

Specifying Colors.

Example

Here we draw two shapes, one blue and one red. The blue shape uses the Canvas default colors.

[C#]

Canvas canvas = new Canvas(100, 100);
DrawOptions drawOpts = new DrawOptions(canvas);
drawOpts.PaintColor.Color = Color.Blue;
drawOpts.PenColor.Color = Color.DarkBlue;
canvas.DrawOval(new XRect(0, 0, 50, 50), drawOpts);
drawOpts.PaintColor.Color = Color.Red;
drawOpts.PenColor.Color = Color.DarkRed;
canvas.DrawOval(new XRect(50, 50, 50, 50), drawOpts);
canvas.SaveAs(Server.MapPath("DrawOptions_PaintColor_82.png"));


[Visual Basic]

Dim canvas As New Canvas(100, 100)
Dim drawOpts As New DrawOptions(canvas)
drawOpts.PaintColor.Color = Color.Blue
drawOpts.PenColor.Color = Color.DarkBlue
canvas.DrawOval(New XRect(0, 0, 50, 50), drawOpts)
drawOpts.PaintColor.Color = Color.Red
drawOpts.PenColor.Color = Color.DarkRed
canvas.DrawOval(New XRect(50, 50, 50, 50), drawOpts)
canvas.SaveAs(Server.MapPath("DrawOptions_PaintColor_82.png"))



DrawOptions_PaintColor_82.png