如何制作笔

此示例创建一个 Pen 对象。

System::Drawing::Pen^ myPen;
myPen = gcnew System::Drawing::Pen(System::Drawing::Color::Tomato);
System.Drawing.Pen myPen;
myPen = new System.Drawing.Pen(System.Drawing.Color.Tomato);
Dim myPen As System.Drawing.Pen
myPen = New System.Drawing.Pen(System.Drawing.Color.Tomato)

可靠的编程

使用使用系统资源的对象(如 Pen 对象)后,应对其调用 Dispose

另请参阅