Поделиться через


InkAnalyzer.Analyze - метод

Обновлен: Ноябрь 2007

Performs synchronous ink analysis.

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink.Analysis (в Microsoft.Ink.Analysis.dll)

Синтаксис

'Декларация
Public Function Analyze As AnalysisStatus
'Применение
Dim instance As InkAnalyzer
Dim returnValue As AnalysisStatus

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

Возвращаемое значение

Тип: Microsoft.Ink.AnalysisStatus
The status of the analysis operation.

Заметки

This method starts a synchronous ink analysis operation. Ink analysis includes layout analysis, writing and drawing classification, and handwriting recognition. The operation returns after the analysis operation 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 ResultsUpdated and IntermediateResultsUpdated 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.

Примеры

This example defines an event handler for a menu item's click event. The event handler performs synchronous ink analysis if the InkAnalyzer object's DirtyRegion is not empty. It attaches a 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.

''' <summary>
''' The Ink menu's Analyze menu item's Click event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Private Sub theInkAnalyzeMenuItem_Click( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles theInkAnalyzeMenuItem.Click

    ' 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 Microsoft.Ink.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(theStatus)
    End If

End Sub 'theInkAnalyzeMenuItem_Click
/// <summary>
/// The Ink menu's Analyze menu item's Click event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
private void theInkAnalyzeMenuItem_Click(object sender, EventArgs 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 Microsoft.Ink.ActivityEventHandler(
            theInkAnalyzer_Activity);

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

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

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

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

InkAnalyzer Класс

InkAnalyzer - члены

Microsoft.Ink - пространство имен

InkAnalyzer.AnalysisModes

InkAnalyzer.DirtyRegion

InkAnalyzer.RootNode

InkAnalyzer.BackgroundAnalyze