InkPicture.SetWindowInputRectangle 方法

设置在其中绘制墨迹 的窗口矩形(以像素为单位)。

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

语法

声明
Public Sub SetWindowInputRectangle ( _
    windowInputRectangle As Rectangle _
)
用法
Dim instance As InkPicture
Dim windowInputRectangle As Rectangle

instance.SetWindowInputRectangle(windowInputRectangle)
public void SetWindowInputRectangle(
    Rectangle windowInputRectangle
)
public:
void SetWindowInputRectangle(
    Rectangle windowInputRectangle
)
public void SetWindowInputRectangle(
    Rectangle windowInputRectangle
)
public function SetWindowInputRectangle(
    windowInputRectangle : Rectangle
)

参数

备注

默认情况下,窗口输入矩形设置为 {0,0,0,0}。此默认矩形映射到整个窗口的大小。

  • 若要将窗口输入矩形重置为具有默认坐标的空矩形,请在对 SetWindowInputRectangle 方法的调用中传递 {0,0,0,0} 而不是 nullnull 引用(在 Visual Basic 中为 Nothing)(在 Microsoft(R) Visual Basic(R) .NET 中为 Nothing)。

如果 Right 属性的值小于 Left 属性的值,或 Bottom 属性的值小于 Top 属性的值,则不能传递矩形。例如,参数为 {500, 500, 400, 400} 的矩形是无效的。

您可以指定负坐标空间中的矩形,但这种矩形没有意义,因为它始终不是能够进行墨迹书写的窗口。

警告

如果将窗口输入矩形设置为与 Splitter control(Splitter 控件)或窗口的边框重叠,则调整窗口大小时可能发生不可预知的结果。

示例

此 C# 示例调用 SetWindowInputRectangle 方法将墨迹输入区设置为它所附加到的 InkPicture 对象 theInkPicture 的整个窗口的大小。

[C#]

using Microsoft.Ink;
//...
InkPicture theInkCollector;
public Form1()
{
    // Initialization
    theInkCollector = new InkPicture(Handle);
    Rectangle theRect = new Rectangle(0,0,0,0);
    theInkPicture.SetWindowInputRectangle(theRect);
    //...
}

此 Microsoft(R) Visual Basic(R) .NET 示例调用 SetWindowInputRectangle 方法将墨迹输入区域设置为其附加到的 InkPicture 对象 theInkPicture 的整个窗口的大小。

[Visual Basic]

Imports Microsoft.Ink
Dim theInkPicture As InkPicture
Public Sub Form1()
    'Initialization
    Dim theRect As Rectangle
    theInkPicture = New InkPicture(Handle)
    theRect = New Rectangle(0,0,0,0)
    theInkPicture.SetWindowInputRectangle(theRect)
    '...
End Sub

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkPicture 类

InkPicture 成员

Microsoft.Ink 命名空间

InkPicture.GetWindowInputRectangle