Procedimiento para crear un lápiz

En este ejemplo se crea un objeto Pen.

Ejemplo

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)

Programación sólida

Una vez que haya terminado de usar objetos que consumen recursos del sistema (como objetos Pen), debe llamar a Dispose en ellos.

Consulte también