如何创建笔

此示例创建一个 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

另请参阅