共用方式為


如何:建立畫筆

此範例會建立 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

另請參閱