Share via


RecognizerGuide.Rows Property

Gets or sets the number of rows in the recognition guide box.

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

Syntax

'Declaration
Public Property Rows As Integer
'Usage
Dim instance As RecognizerGuide 
Dim value As Integer 

value = instance.Rows

instance.Rows = value
public int Rows { get; set; }
public:
property int Rows {
    int get ();
    void set (int value);
}
public function get Rows () : int 
public function set Rows (value : int)

Property Value

Type: System.Int32
The number of rows in the guide box.

Remarks

Row height is determined by the size of the drawn box. To get or set the drawn box, use the DrawnBox property.

Use the values of the Columns and Rows properties to control the kind of recognition input that you use. When the Columns and Rows properties are both greater than zero, boxed input is used. The following table lists potential input modes and which values to set the Columns and Rows properties for each mode.

For this type of input

Set the Rows property to

And set the Columns property to

Free input

0

0

Vertical Lined input with 1 line

0

1

Vertical Lined input with n lines

0

n

Horizontal Lined input with 1 line

1

0

Horizontal Lined input with n lines

n

0

Boxed input with 1 box

1

1

Boxed input with 1 column of n boxes

1

n

Boxed input in a grid of boxes x rows by z columns

x

z

Examples

In this example, a RecognizerContext object is instantiated, and the Guide property assigned by creating a new RecognizerGuide object.

' create a new RecognizerContext object
mRecognizerContext = New RecognizerContext()
' if the Recognizer supports LinedInput, set the Guide 
If (mRecognizerContext.Recognizer.Capabilities And RecognizerCapabilities.LinedInput) <> 0 Then 
    ' get the lower right corner in pixel units 
    Dim lowerRight As Point = New Point(mInkOverlay.AttachedControl.Width, mInkOverlay.AttachedControl.Height)
    ' convert to ink space units
    mInkOverlay.Renderer.PixelToInkSpace(Me.CreateGraphics(), lowerRight)
    ' create Rectangles 
    Dim writingBox As Rectangle = New Rectangle(0, 0, lowerRight.X, lowerRight.Y)
    Dim drawnBox As Rectangle = New Rectangle(0, 0, lowerRight.X, lowerRight.Y)
    ' shrink drawn box relative to writing box
    drawnBox.Inflate(-100, -100)
    ' create Guide with 8 rows, zero columns, and no midline 
    Dim guide As RecognizerGuide = New RecognizerGuide(8, 0, 0, writingBox, drawnBox)
    mRecognizerContext.Guide = guide
End If
// create a new RecognizerContext object
mRecognizerContext = new RecognizerContext();
// if the Recognizer supports LinedInput, set the Guide 
if ((mRecognizerContext.Recognizer.Capabilities & RecognizerCapabilities.LinedInput) != 0)
{
    // get the lower right corner in pixel units
    Point lowerRight = new Point(mInkOverlay.AttachedControl.Width, mInkOverlay.AttachedControl.Height);
    // convert to ink space units
    mInkOverlay.Renderer.PixelToInkSpace(this.CreateGraphics(), ref lowerRight);
    // create Rectangles
    Rectangle writingBox = new Rectangle(0, 0, lowerRight.X, lowerRight.Y);
    Rectangle drawnBox = new Rectangle(0, 0, lowerRight.X, lowerRight.Y);
    // shrink drawn box relative to writing box
    drawnBox.Inflate(-100, -100);
    // create Guide with 8 rows, zero columns, and no midline
    RecognizerGuide guide = new RecognizerGuide(8, 0, 0, writingBox, drawnBox);
    mRecognizerContext.Guide = guide;
}

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

RecognizerGuide Structure

RecognizerGuide Members

Microsoft.Ink Namespace

RecognizerGuide.DrawnBox

RecognizerGuide.Columns