다음을 통해 공유


RecognizerContext.Guide Property

RecognizerContext.Guide Property

Gets or sets the RecognizerGuide to use for ink input.

Definition

Visual Basic .NET Public Property Guide As RecognizerGuide
C# public RecognizerGuide Guide { get; set; }
Managed C++ public: __property RecognizerGuide* get_Guide();
public: __property void set_Guide(RecognizerGuide*);

Property Value

Microsoft.Ink.RecognizerGuide. The RecognizerGuide to use for ink input.

This property is read/write. This property has no default value.

Exceptions

COMException Leave Site:
ObjectDisposedException Leave Site:

Remarks

Setting the Guide property succeeds only if the Strokes property is null. You must set the Guide property before you attach a Strokes collection to the Strokes property of the RecognizerContext, or you must set the Strokes property to null and then set the Guide property.

Note: If you use the latter method, you may need to reattach the Strokes collection to the Strokes property of the RecognizerContext.

The RecognizerCapabilities enumeration contains the FreeInput, LinedInput, and BoxedInput flags. These flags specify the capabilities of a recognizer, but because they are read-only, there is no way to set any of these directly on a Recognizer or RecognizerContext object. The only way to set a recognizer to a specific mode is to set the guide by using the Guide property.

If you do not set the Guide property, the default value is FreeInput mode, assuming that the recognizer is capable of this mode.

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 n boxes n 1
Boxed input in a grid of boxes x rows by z columns x z

If you set the mode to one that is not available for a Recognizer object, an ArgumentException Leave Site exception is thrown.

To query which capabilities—or modes—are available from a specific recognizer, use the Capabilities property of the Recognizer object. In general, Latin language recognizers support free input and horizontal lined input; East Asian language recognizers support free input and boxed input; and the gesture recognizer supports only free input.

Examples

[C#]

This C# example creates a RecognizerGuide and assigns it to the Guide property of the RecognizerContext object, theRecognizerContext.

theRecognizerContext.Guide = new RecognizerGuide(rows, columns, midline, rectGuide, rectDrawn);

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example creates a RecognizerGuide and assigns it to the Guide property of the RecognizerContext object, theRecognizerContext.

theRecognizerContext.Guide = New RecognizerGuide( _
    rows, columns, midline, rectGuide, rectDrawn)

See Also