Condividi tramite


InkAnalyzer.Analyze Method

Performs synchronous ink analysis, which includes layout analysis, writing and drawing classification, and handwriting recognition.

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

Syntax

'Declaration
Public Function Analyze As AnalysisStatus
'Usage
Dim instance As InkAnalyzer
Dim returnValue As AnalysisStatus

returnValue = instance.Analyze
public AnalysisStatus Analyze ()
public:
AnalysisStatus^ Analyze ()
public AnalysisStatus Analyze ()
public function Analyze () : AnalysisStatus
Not applicable.

Return Value

The status of the analysis operation.

Remarks

This method starts a synchronous ink analysis operation. Ink analysis includes layout analysis, writing and drawing classification, and handwriting recognition. The operation returns a status after the analysis is complete. The InkAnalyzer analyzes ink only within its DirtyRegion.

This method sets the InkAnalyzer object's DirtyRegion to an empty region. If another thread has added stroke data that has not been analyzed, the InkAnalyzer adds the bounding box of the unanalyzed strokes to its DirtyRegion during the reconcile phase of the analysis.

The InkAnalyzer does not raise the Results and IntermediateResults events in response to this method.

To modify the way ink analysis is performed, use the InkAnalyzer object's AnalysisModes property.

For more information about ink analysis, see Ink Analysis Overview.

Example

This example defines an event handler for a button's click event. The event handler performs synchronous ink analysis if the InkAnalyzer object's DirtyRegion is not empty. It attaches an InkAnalyzer.Activity event handler and performs the analysis. It then removes the event handler and calls a helper method, UpdateResults, to update the form with the results of the analysis.

Sub AnalyzeButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs) 

    ' Only start ink analysis if the dirty region is not empty.
    If Not Me.theInkAnalyzer.DirtyRegion.IsEmpty Then

        ' Attach an activity event handler.
        AddHandler Me.theInkAnalyzer.Activity, AddressOf theInkAnalyzer_Activity
        
        ' Perform the ink analysis.
        Dim theStatus As AnalysisStatus = Me.theInkAnalyzer.Analyze()
        
        ' Remove the activity event handler.
        RemoveHandler Me.theInkAnalyzer.Activity, AddressOf theInkAnalyzer_Activity
        
        ' Update the analysis results on the form.
        Me.UpdateResults()
    End If

End Sub 'AnalyzeButton_Click
void AnalyzeButton_Click(object sender, RoutedEventArgs e)
{
    // Only start ink analysis if the dirty region is not empty.
    if (!this.theInkAnalyzer.DirtyRegion.IsEmpty)
    {
        // Attach an activity event handler.
        this.theInkAnalyzer.Activity +=
            new ActivityEventHandler(
            theInkAnalyzer_Activity);

        // Perform the ink analysis.
        AnalysisStatus theStatus =
            this.theInkAnalyzer.Analyze();

        // Remove the activity event handler.
        this.theInkAnalyzer.Activity -=
            new ActivityEventHandler(
                theInkAnalyzer_Activity);

        // Update the analysis results on the form.
        this.UpdateResults();
    }

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

InkAnalyzer Class
InkAnalyzer Members
System.Windows.Ink Namespace
System.Windows.Ink.InkAnalyzerBase.AnalysisModes
InkAnalyzer.DirtyRegion
InkAnalyzer.RootNode
System.Windows.Ink.InkAnalyzerBase.BackgroundAnalyze