InkOverlayPaintedEventHandler 委托

表示处理 InkOverlay 对象的 Painted 事件的方法。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Delegate Sub InkOverlayPaintedEventHandler ( _
    sender As Object, _
    e As PaintEventArgs _
)
用法
Dim instance As New InkOverlayPaintedEventHandler(AddressOf HandlerMethod)
public delegate void InkOverlayPaintedEventHandler(
    Object sender,
    PaintEventArgs e
)
public delegate void InkOverlayPaintedEventHandler(
    Object^ sender, 
    PaintEventArgs^ e
)
/** @delegate */
public delegate void InkOverlayPaintedEventHandler(
    Object sender,
    PaintEventArgs e
)
JScript 不支持委托。

参数

备注

创建 InkOverlayPaintedEventHandler 委托时,需要标识将处理该事件的方法。若要将该事件与事件处理程序关联,请将该委托的一个实例添加到事件中。除非移除了该委托,否则每当发生该事件时就会调用此事件处理程序。出于性能方面的原因,默认事件关注在托管代码 中处于关闭状态,但如果添加事件处理程序,它将自动打开。

示例

在此示例中,Painted 事件处理程序用于在墨迹画布上绘制水印。

Private Sub mInkObject_Painted(ByVal sender As Object, ByVal e As PaintEventArgs)
    Const X As Integer = 12
    Const Y As Integer = 12
    Const COMPANY As String = "Graphic Design Institute"
    Const WEB_SITE As String = "http://www.graphicdesigninstitute.com/"

    Dim cFont As Font = New Font("Arial", 18)
    Dim wFont As Font = New Font("Arial", 9)
    Dim cSize As SizeF = e.Graphics.MeasureString(COMPANY, cFont)

    e.Graphics.DrawString(COMPANY, cFont, Brushes.Wheat, X, Y)
    e.Graphics.DrawString(WEB_SITE, wFont, Brushes.SlateGray, X, cSize.Height + Y)
End Sub
private void mInkObject_Painted(object sender, PaintEventArgs e)
{
    const int X = 12;
    const int Y = 12;
    const string COMPANY = "Graphic Design Institute";
    const string WEB_SITE = "http://www.graphicdesigninstitute.com/";

    Font cFont = new Font("Arial", 18);
    Font wFont = new Font("Arial", 9);
    SizeF cSize = e.Graphics.MeasureString(COMPANY, cFont);

    e.Graphics.DrawString(COMPANY, cFont, Brushes.Wheat, X, Y);
    e.Graphics.DrawString(WEB_SITE, wFont, Brushes.SlateGray, X, cSize.Height + Y);
}

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

Microsoft.Ink 命名空间

InkOverlayPaintingEventHandler