다음을 통해 공유


AnalysisHintNode Class

Provides an InkAnalyzer with an analysis hint for a region.

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

Syntax

'Declaration
Public NotInheritable Class AnalysisHintNode
    Inherits ContextNode
'Usage
Dim instance As AnalysisHintNode
public sealed class AnalysisHintNode : ContextNode
public ref class AnalysisHintNode sealed : public ContextNode
public final class AnalysisHintNode extends ContextNode
public final class AnalysisHintNode extends ContextNode
Not applicable.

Remarks

An AnalysisHintNode provides a hint for the InkAnalyzer to which it is attached. The hint applies to the area specified by the Location property of the AnalysisHintNode.and provides extra context to the ink analyzer to improve recognition accuracy. The InkAnalyzer applies this context information when analyzing ink within the hint's area.

If a hint is assigned an infinite area, termed a global hint, then the InkAnalyzer applies the hint's context to all ink that is not within other hint areas. Multiple hints may be attached to a single InkAnalyzer. However, only one global hint can be attached to a single InkAnalyzer, and no non-global hints can overlap. For more information about the types of context information that a hint can provide, see the members page of the AnalysisHintNode.

To add a hint to an InkAnalyzer, use InkAnalyzer.CreateAnalysisHint. To remove a hint from an InkAnalyzer, use System.Windows.Ink.InkAnalyzer.DeleteAnalysisHint.

Note

Adding a hint to an InkAnalyzer does not change the InkAnalyzer object's DirtyRegion. To have the InkAnalyzer reanalyze ink within the hint's area, use the DirtyRegion object's Union(AnalysisRegion) method.

The InkAnalyzer updates the hint's Links property each time the Analyze or BackgroundAnalyze method is called. The InkAnalyzer adds a ContextLink between the AnalysisHintNode and each ContextNode to which the hint applies. If a hint applies to all of the descendants of a ContextNode, the InkAnalyzer links the hint only to that ContextNode, and not to any of its descendants.

The Location property of an AnalysisHintNode will not be used to apply the hint to a custom recognizer node. If you create a hint and set its location to include the strokes in the CustomRecognizerNode, that hint will not be applied to those strokes. To apply the hint correctly to the strokes inside a custom recognizer node, create a link between the AnalysisHintNode and CustomRecognizerNode before calling Analyze. For example, assume that there is an AnalysisHintNode called theAnalysisHint and a CustomRecognizerNode called theCustomRecognizerNode. To create a link between the two, use theAnalysisHint.Links.Add(theCustomRecognizerNode, ContextLinkDirection.LinksWith).

Only one non-global hint can be applied to a CustomRecognizerNode. To remove a non-global hint from a CustomRecognizerNode, use System.Windows.Ink.ContextLinkCollection.Remove which removes the link from the Links property of the CustomRecognizerNode.

If a non-global hint for a non-empty area is applied to a CustomRecognizerNode, the InkAnalyzer applies the hint's context to both the CustomRecognizerNode and to ink within the hint's area.

No links from an AnalysisHintNode to CustomRecognizerNode are created or deleted when analysis occurs.

When using hints in a form application, avoid mixing text context with ink in the forms. This means for example that text field names should not be created in the analysis tree. Hints are meant to associate the ink to areas on pages; any text context will interfere with this ink to hint association. The analysis operation may merge the ink and the text context in the same writing region which would prevent the ink from being associated with the hint area.

Example

This example creates an AnalysisHintNode, theAnalysisHint, for the InkAnalyzer, theInkAnalyzerWithHint, and makes theAnalysisHint a global hint by making its area infinite. It then sets the AllowPartialDictionaryTerms and Name properties on the hint.

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

theAnalysisHint.AllowPartialDictionaryTerms = True
theAnalysisHint.Name = "Allow Partial Dictionary Terms"
// Add a new, global analysis hint to theInkAnalyzerWithHint.
AnalysisHintNode theAnalysisHint =
    this.theInkAnalyzerWithHint.CreateAnalysisHint();
theAnalysisHint.Location.MakeInfinite();

theAnalysisHint.AllowPartialDictionaryTerms = true;
theAnalysisHint.Name = "Allow Partial Dictionary Terms";

Inheritance Hierarchy

System.Object
   System.Windows.Ink.ContextNode
    System.Windows.Ink.AnalysisHintNode

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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 Members
System.Windows.Ink Namespace
System.Windows.Ink.ContextLink
System.Windows.Ink.AnalysisRegion
System.Windows.Ink.InkAnalyzer