Pen(Color32, Single) Constructor

Initializes a new instance of the Pen class with the specified color and width.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 10.0.0-rc.1
C#
public Pen(
	Color32 color,
	float width = 1f
)

Parameters

color  Color32
The color of the Pen.
width  Single  (Optional)
The width of the Pen. Must be greater than 0. This parameter is optional.
Default value: 1.

Remarks

A width of 1/64 or less is not visible. If FastThinLines is and AntiAliasing is , then a width less than 1/4 is not visible.

If the color depth of a Color32 instance is not enough to represent the specified color, then create a solid brush with the desired color depth and use the Pen(Brush, Single) constructor instead.

Exceptions

ArgumentOutOfRangeExceptionwidth is not greater than 0.

See Also