Share via


InkPicture.SetWindowInputRectangle Method

Sets the window rectangle, in pixels, within which ink is drawn.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Sub SetWindowInputRectangle ( _
    windowInputRectangle As Rectangle _
)
'Usage
Dim instance As InkPicture 
Dim windowInputRectangle As Rectangle

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

Parameters

Remarks

By default, the window input rectangle is set to {0,0,0,0}. This default rectangle maps to the size of the entire window

  • To reset the window input rectangle to an empty rectangle with the default coordinates, pass {0,0,0,0} in the call to the SetWindowInputRectangle method, rather than nulla null reference (Nothing in Visual Basic) (Nothing in Microsoft® Visual Basic® .NET).

You cannot pass in a rectangle where the value of the Right property is less than the value of the Left property; or where the value of the Bottom property is less than the value of the Top property. For example, a rectangle with parameters of {500, 500, 400, 400} is not valid

A rectangle in negative coordinate space can be specified but is meaningless, because it always results in a window that cannot be inked upon.

Warning

If you set the window input rectangle to overlap a Splitter control or the borders of the window, unpredictable results may occur when the window is resized

Examples

This C# example calls the SetWindowInputRectangle method to set the ink input area to the size of the entire window of the InkPicture object, theInkPicture, to which it is attached.

[C#]

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

This Microsoft® Visual Basic® .NET example calls the SetWindowInputRectangle method to set the ink input area to the size of the entire window of the InkPicture object, theInkPicture, to which it is attached.

[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

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkPicture Class

InkPicture Members

Microsoft.Ink Namespace

InkPicture.GetWindowInputRectangle