InkPicture.Painted 事件
当 InkPicture 对象已完成对自己的重新绘制时发生。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink(在 Microsoft.Ink.dll 中)
语法
声明
Public Event Painted As InkOverlayPaintedEventHandler
用法
Dim instance As InkPicture
Dim handler As InkOverlayPaintedEventHandler
AddHandler instance.Painted, handler
public event InkOverlayPaintedEventHandler Painted
public:
event InkOverlayPaintedEventHandler^ Painted {
void add (InkOverlayPaintedEventHandler^ value);
void remove (InkOverlayPaintedEventHandler^ value);
}
/** @event */
public void add_Painted (InkOverlayPaintedEventHandler value)
/** @event */
public void remove_Painted (InkOverlayPaintedEventHandler value)
JScript 不支持事件。
备注
事件处理程序接收 PaintEventArgs 类型的参数,该参数包含有关此事件的数据。
创建 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