活动
如何制作笔
此示例创建一个 Pen 对象。
System::Drawing::Pen^ myPen;
myPen = gcnew System::Drawing::Pen(System::Drawing::Color::Tomato);
C#
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)
其他资源
培训
模块
Get started with classes and objects in C# - Training
Learn how to create classes and instantiate objects that expose encapsulated field data by using class definitions, constructors, and the 'new' operator.
文档
-
如何绘制轮廓形状 - Windows Forms .NET Framework
了解如何使用以下说明、示例和链接绘制轮廓形状,包括椭圆和矩形。
-
图形编程入门 - Windows Forms .NET Framework
开始在 Windows 窗体应用程序中使用 GDI+。 了解如何完成多个 GDI+ 任务,例如绘制和填充形状和文本。
-
如何:在 Windows 窗体上绘制填充矩形 - Windows Forms .NET Framework
了解如何以编程方式在 Windows 窗体上绘制填充的矩形。 另请了解如何编译代码。