Constructor Pen
Pen(Color32, double)
Initializes a new instance of the Pen class with the specified color and thickness.
public Pen(Color32 color, double size)
Parameters
colorColor32The color of the pen.
sizedoubleThe thickness of the pen. Must be greater than zero.
Examples
// Simple black pen, 1 pixel thick.
var thin = new Pen(new Color32(0, 0, 0), 1);
// Thick blue pen with inside alignment.
var thick = new Pen(new Color32(0, 0, 255), 5) { Alignment = PenAlignment.Inside };
Exceptions
- ArgumentOutOfRangeException
Thrown if
sizeis less than or equal to zero.