Sdílet prostřednictvím


AnalysisHintNode.Guide Property

Gets or sets the recognizer guide used by the InkAnalyzer to analyze ink within the current area.

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.dll)

Syntax

'Declaration
Public Property Guide As InkRecognizerGuide
'Usage
Dim instance As AnalysisHintNode 
Dim value As InkRecognizerGuide 

value = instance.Guide

instance.Guide = value
public InkRecognizerGuide Guide { get; set; }
public:
property InkRecognizerGuide^ Guide {
    InkRecognizerGuide^ get ();
    void set (InkRecognizerGuide^ value);
}
public function get Guide () : InkRecognizerGuide 
public function set Guide (value : InkRecognizerGuide)

Property Value

Type: System.Windows.Ink.InkRecognizerGuide
The recognizer guide that the InkAnalyzer uses to analyze ink within the current area. The default is an InkRecognizerGuide where all of its properties are set to 0.

Remarks

Note

If the System.Windows.Ink.InkRecognizer that the InkAnalyzer uses for handwriting recognition does not support guides, the InkAnalyzer ignores the guide. For more information about the capabilities that an InkRecognizer supports, see InkRecognizer.Capabilities.

All coordinates of the RecognizerGuide are in ink-space coordinates and are relative to the top left corner of the hint. The guide is not translated for a global hint since it uses the Ink object's coordinate system. For more information about using a guide to improve handwriting recognition, see RecognizerGuide.

During analysis, if the ink recognizer applied to the strokes does not support a guide, the ink analyzer generates an AnalysisWarning with its WarningCode property set to the System.Windows.Ink.AnalysisWarningCode value of GuideNotSupported.

To remove a guide from a hint, call the ClearGuide method, or the hint's RemovePropertyData(Guid) method with propertyDataId set to PropertyGuidsForAnalysisHints.Guide.

Examples

This example creates an AnalysisHintNode (named theAnalysisHint) for the InkAnalyzer (named theInkAnalyzerWithHint) and makes theAnalysisHint a global hint. It then sets the Guide and Name properties on the hint.

Dim guideBoxTop As Double = 0
Dim guideBoxBottom As Double = 50
Dim guideBoxLeft As Double = 0
Dim guideBoxRight As Double = 600

Dim WRITINGBOXMARGIN As Integer = 10

' Find the midline of the guide box. 
Dim midline As Double = (guideBoxBottom - guideBoxTop) / 2 + guideBoxTop

' Add a new, global analysis hint to theInkAnalyzerWithHint. 
Dim theAnalysisHint As AnalysisHintNode = Me.theInkAnalyzerWithHint.CreateAnalysisHint()
theAnalysisHint.Location.MakeInfinite()

' Create an InkRecognizerGuide with the writing box 
' slightly larger than the drawing box. 
Dim theGuide As New InkRecognizerGuide(1, 0, midline, _
    guideBoxLeft - WRITINGBOXMARGIN, guideBoxTop - WRITINGBOXMARGIN, _
    guideBoxRight + WRITINGBOXMARGIN, guideBoxBottom + WRITINGBOXMARGIN, _
    guideBoxLeft, guideBoxTop, guideBoxRight, guideBoxBottom)

theAnalysisHint.Guide = theGuide
theAnalysisHint.Name = "Recognizer Guide"
double guideBoxTop = 0;
double guideBoxBottom = 50;
double guideBoxLeft = 0;
double guideBoxRight = 600;

const int WRITINGBOXMARGIN = 10;

// Find the midline of the guide box. 
double midline = (guideBoxBottom - guideBoxTop) / 2 + guideBoxTop;

// Add a new, global analysis hint to theInkAnalyzerWithHint.
AnalysisHintNode theAnalysisHint =
    this.theInkAnalyzerWithHint.CreateAnalysisHint();
theAnalysisHint.Location.MakeInfinite();

// Create an InkRecognizerGuide with the writing box 
// slightly larger than the drawing box.
InkRecognizerGuide theGuide = new InkRecognizerGuide(1, 0, midline, 
    guideBoxLeft - WRITINGBOXMARGIN, guideBoxTop - WRITINGBOXMARGIN, 
    guideBoxRight + WRITINGBOXMARGIN, guideBoxBottom + WRITINGBOXMARGIN,
    guideBoxLeft, guideBoxTop, guideBoxRight, guideBoxBottom);

theAnalysisHint.Guide = theGuide;
theAnalysisHint.Name = "Recognizer Guide";

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

AnalysisHintNode Class

AnalysisHintNode Members

System.Windows.Ink Namespace

RecognizerGuide