RecognizerContext.Strokes Property
Gets or sets the Strokes collection associated with the RecognizerContext object.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)
Syntax
'Declaration
Public Property Strokes As Strokes
'Usage
Dim instance As RecognizerContext
Dim value As Strokes
value = instance.Strokes
instance.Strokes = value
public Strokes Strokes { get; set; }
public:
property Strokes^ Strokes {
Strokes^ get ();
void set (Strokes^ value);
}
/** @property */
public Strokes get_Strokes ()
/** @property */
public void set_Strokes (Strokes value)
public function get Strokes () : Strokes
public function set Strokes (value : Strokes)
Not applicable.
Property Value
The Strokes collection associated with the RecognizerContext object.
Remarks
You must assign a Strokes collection to a RecognizerContext object in order for the RecognizerContext object to perform handwriting recognition. This property maintains the Strokes collection from which the RecognizerContext object creates the RecognitionResult object.
You can set the Strokes collection more than once. Each time you set the Strokes collection, the RecognizerContext object is reset—any ink or results are removed and any prior calls to the EndInkInput method are disregarded—and then the new strokes are added.
The Strokes collection can also be set to a null reference (Nothing in Visual Basic), which also resets the RecognizerContext object. When the RecognizerContext is reset, it keeps any recognition guide, factoid, and other properties which previously had been set on it.
When the RecognizerContext object is reset, any recognition taking place on the background thread is cancelled.
To keep the Strokes property of the RecognizerContext object synchronized with the strokes associated with an Ink object, use the InkAdded and InkDeleted events of the Ink object to listen for strokes that should be added or removed from the Strokes collection assigned to the RecognizerContext object. This covers cases where strokes are added to, deleted from, clipped, or split within the Ink object.
Note
Moving, scaling, or other transformations on strokes in the Ink object do not generate InkAdded or InkDeleted events. Perform the same transformations on the strokes in the RecognizerContext object to keep the Strokes property of the RecognizerContext object synchronized.
Example
This C# example removes the Strokes property of a RecognizerContext object, theRecognizerContext
, to reset the RecognizerContext object without affecting its other properties.
theRecognizerContext.Strokes = null;
This Microsoft® Visual Basic® .NET example removes the Strokes property of a RecognizerContext object, theRecognizerContext
, to reset the RecognizerContext object without affecting its other properties.
theRecognizerContext.Strokes = Nothing
Platforms
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
RecognizerContext Class
RecognizerContext Members
Microsoft.Ink Namespace
Strokes
RecognizerContext.EndInkInput