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


InkAnalyzer.AddStroke - метод (Stroke)

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

Adds a Stroke to the InkAnalyzer and assigns the active input thread's locale identifier to the stroke.

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

Синтаксис

'Декларация
Public Function AddStroke ( _
    strokeToAdd As Stroke _
) As ContextNode
'Применение
Dim instance As InkAnalyzer
Dim strokeToAdd As Stroke
Dim returnValue As ContextNode

returnValue = instance.AddStroke(strokeToAdd)
public ContextNode AddStroke(
    Stroke strokeToAdd
)
public:
ContextNode^ AddStroke(
    Stroke^ strokeToAdd
)
public ContextNode AddStroke(
    Stroke strokeToAdd
)
public function AddStroke(
    strokeToAdd : Stroke
) : ContextNode

Параметры

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

Тип: Microsoft.Ink.ContextNode
The ContextNode to which strokeToAdd was added.

Заметки

The InkAnalyzer adds the Stroke to an UnclassifiedInkNode in the RootNode property's SubNodes collection. The Stroke, strokeToAdd, is assigned the locale identifier of the active input thread and is added to the first UnclassifiedInkNode containing strokes with the same locale identifier. If no such UnclassifiedInkNode exists, a new UnclassifiedInkNode is created and strokeToAdd is added to the new UnclassifiedInkNode.

This method expands the DirtyRegion to the union of the region's current value and the bounding box of the added stroke.

If the stroke is already attached to the InkAnalyzer, the InkAnalyzer throws an exception.

Примеры

This example does the following.

' Create and enable the InkCollector and attach event handlers.
Me.theInkCollector = New Microsoft.Ink.InkCollector(Me.theInkingPanel)
AddHandler Me.theInkCollector.Stroke, AddressOf Me.theInkCollector_Stroke
Me.theInkCollector.Enabled = True

' Create the InkAnalyzer.
Me.theInkAnalyzer = New Microsoft.Ink.InkAnalyzer(Me.theInkCollector.Ink, Me)
// Create and enable the InkCollector and attach event handlers.
this.theInkCollector =
    new Microsoft.Ink.InkCollector(this.theInkingPanel);
this.theInkCollector.Stroke +=
    new Microsoft.Ink.InkCollectorStrokeEventHandler(
        this.theInkCollector_Stroke);
this.theInkCollector.Enabled = true;

// Create the InkAnalyzer.
this.theInkAnalyzer =
    new Microsoft.Ink.InkAnalyzer(this.theInkCollector.Ink, this);

In this example, the theInkCollector_Stroke event handler then takes the stroke that has been added to the theInkCollector and adds it to theInkAnalyzer.

''' <summary>
''' The ink collector's InkAdded event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInkCollector_Stroke( _
    ByVal sender As Object, ByVal e As Microsoft.Ink.InkCollectorStrokeEventArgs)

    ' Add the new stroke to the InkAnalyzer.
    Me.theInkAnalyzer.AddStroke(e.Stroke)

End Sub 'theInkCollector_Stroke
/// <summary>
/// The ink collector's Stroke event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInkCollector_Stroke(
    object sender, Microsoft.Ink.InkCollectorStrokeEventArgs e)
{
    // Add the new stroke to the InkAnalyzer.
    this.theInkAnalyzer.AddStroke(e.Stroke);
}

Платформы

Windows Vista

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

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

.NET Framework

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

См. также

Ссылки

InkAnalyzer Класс

InkAnalyzer - члены

AddStroke - перегрузка

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

InkAnalyzer.AddStrokes

InkAnalyzer.RemoveStroke

InkAnalyzer.RemoveStrokes