Version

CreatePen(Color,Single) Method

Returns a System.Drawing.Pen representing the color.
Syntax
'Declaration
 
Public Overloads Shared Function CreatePen( _
   ByVal color As Color, _
   ByVal width As Single _
) As Pen
public static Pen CreatePen( 
   Color color,
   float width
)

Parameters

color
The desired color.
width
The width of the new pen.

Return Value

Remarks
If the color's IsSystemColor property returns true will create a brush from the color's ARGB equivalent. This prevents a memory leak in the .NET framework.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also