Share via


AnalysisHintNode.Guide Property

Gets or sets the recognizer guide that the InkAnalyzer uses to analyze ink within the current area.

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)
XML Namespace:  https://schemas.microsoft.com/winfx/2006/xaml/presentation

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);
}
/** @property */
public InkRecognizerGuide get_Guide ()

/** @property */
public void set_Guide (InkRecognizerGuide value)
public function get Guide () : InkRecognizerGuide

public function set Guide (value : InkRecognizerGuide)
Not applicable.

Property Value

The recognizer guide that the InkAnalyzer uses to analyze ink within this 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. For a global hint, the guide is not translated; 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 method with propertyDataId set to PropertyGuidsForAnalysisHints.Guide.

Example

This example creates an AnalysisHintNode, theAnalysisHint, for the InkAnalyzer, 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 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

AnalysisHintNode Class
AnalysisHintNode Members
System.Windows.Ink Namespace
System.Windows.Ink.RecognizerGuide