Glyph.Paint(PaintEventArgs) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供绘制逻辑。
public:
abstract void Paint(System::Windows::Forms::PaintEventArgs ^ pe);
public abstract void Paint(System.Windows.Forms.PaintEventArgs pe);
abstract member Paint : System.Windows.Forms.PaintEventArgs -> unit
Public MustOverride Sub Paint (pe As PaintEventArgs)
参数
包含事件数据的 A PaintEventArgs 。
示例
下面的示例演示如何重写 Paint 绘制字形。 该代码示例是 BehaviorService 类中的一个较大示例的一部分。
public:
virtual void Paint(PaintEventArgs^ pe) override
{
// Draw our glyph. Our's is simple: a blue ellipse.
pe->Graphics->FillEllipse(Brushes::Blue, Bounds);
}
public override void Paint(PaintEventArgs pe)
{
// Draw our glyph. It is simply a blue ellipse.
pe.Graphics.FillEllipse(Brushes.Blue, Bounds);
}
Public Overrides Sub Paint(ByVal pe As PaintEventArgs)
' Draw our glyph. It is simply a blue ellipse.
pe.Graphics.FillEllipse(Brushes.Blue, Bounds)
End Sub
注解
该方法 Paint 是强制 abstract 实现提供绘制逻辑的方法 Glyph 。 该 pe 参数包含与 Graphics 装饰器窗口 BehaviorService相关的参数。