Compartir a través de


InkAnalyzerBase.UpdateStrokesData (Método)

Actualización: noviembre 2007

Actualiza los datos de paquete para los trazos especificados.

Espacio de nombres:  System.Windows.Ink.AnalysisCore
Ensamblado:  IACore (en IACore.dll)

Sintaxis

'Declaración
Public Sub UpdateStrokesData ( _
    strokeIds As Integer(), _
    strokePacketCounts As Integer(), _
    strokesPacketData As Integer(), _
    strokesPacketDescription As Guid() _
)
'Uso
Dim instance As InkAnalyzerBase
Dim strokeIds As Integer()
Dim strokePacketCounts As Integer()
Dim strokesPacketData As Integer()
Dim strokesPacketDescription As Guid()

instance.UpdateStrokesData(strokeIds, _
    strokePacketCounts, strokesPacketData, _
    strokesPacketDescription)
public void UpdateStrokesData(
    int[] strokeIds,
    int[] strokePacketCounts,
    int[] strokesPacketData,
    Guid[] strokesPacketDescription
)
public:
void UpdateStrokesData(
    array<int>^ strokeIds, 
    array<int>^ strokePacketCounts, 
    array<int>^ strokesPacketData, 
    array<Guid>^ strokesPacketDescription
)
public void UpdateStrokesData(
    int[] strokeIds,
    int[] strokePacketCounts,
    int[] strokesPacketData,
    Guid[] strokesPacketDescription
)
public function UpdateStrokesData(
    strokeIds : int[], 
    strokePacketCounts : int[], 
    strokesPacketData : int[], 
    strokesPacketDescription : Guid[]
)

Parámetros

  • strokeIds
    Tipo: array<System.Int32[]
    Matriz que contiene los identificadores de los trazos.
  • strokePacketCounts
    Tipo: array<System.Int32[]
    Matriz que contiene el número de paquetes de cada trazo.
  • strokesPacketData
    Tipo: array<System.Int32[]
    Matriz que contiene los datos del paquete de los trazos.
  • strokesPacketDescription
    Tipo: array<System.Guid[]
    Matriz que contiene los identificadores de las propiedades del paquete.

Comentarios

strokePacketData contiene datos de paquete para todos los trazos. strokePacketDescription contiene los identificadores únicos globales (GUID) que describen los tipos de datos de paquete incluidos para cada punto de cada trazo. Para obtener una lista completa de las propiedades del paquete disponibles, vea la clase Microsoft.Ink.PacketProperty.

Este método sólo puede actualizar datos de trazo si todos los nuevos datos de trazo tienen la misma descripción de paquete.

Este método no actualiza la DirtyRegion del analizador de entrada manuscrita.

Si un trazo identificado en strokeIds no está asociado al analizador de entradas manuscrita, este método pasará por alto el identificador.

Si ninguno de los trazos identificados en strokeIds es un trazo asociado al analizador de entradas manuscritas, este método devuelve los resultados sin actualizar el analizador de entradas manuscritas.

Este método inicia una excepción System.ArgumentNullException si strokeIds es nullreferencia null (Nothing en Visual Basic).

Ejemplos

En el ejemplo siguiente, se define un método, UpdateStrokesData, que actualiza los datos de trazo para un objeto InkAnalyzerBase especificado. Este método convierte una colección Strokes en datos de paquete y actualiza los datos de trazo en el analizador de entrada manuscrita. En la práctica, si la aplicación utiliza un objeto Microsoft.Ink.Ink para almacenar los datos de trazo, debería utilizar la clase derivada Microsoft.Ink.InkAnalyzer.

''' <summary>
''' Updates the packet data for the specified strokes of an InkAnalyzerBase.
''' </summary>
''' <param name="baseInkAnalyzer">
''' The analyzer that receives the strokes.</param>
''' <param name="theStrokes">
''' The strokes for which to update the stroke data.</param>
''' <remarks>
''' This method converts stroke data to packet data for example only.
''' The InkAnalyzerBase is used when your application is handling packet
''' data. If your application uses stroke data from an Ink object, then
''' you would use InkAnalyzer.
''' </remarks>
Public Shared Sub MyUpdateStrokesData( _
ByVal baseInkAnalyzer As System.Windows.Ink.AnalysisCore.InkAnalyzerBase, _
ByVal theStrokes As Microsoft.Ink.Strokes)

    ' Check that the parameters are valid
    If Nothing Is baseInkAnalyzer Then
        Throw New ArgumentNullException("baseInkAnalyzer")
    End If

    If Nothing Is theStrokes Then
        Throw New ArgumentNullException("theStrokes")
    End If

    If 0 = theStrokes.Count Then
        Throw New ArgumentException("Empty strokes collection.")
    End If

    ' Only strokes that have the same packet description GUIDs
    ' can be added in one call to InkAnalyzerBase.AddStrokes.
    Dim thePacketDescription As Guid() = theStrokes(0).PacketDescription

    ' Accumulate the stroke data in collections.
    Dim theStrokeIdentifiers As New ArrayList()
    Dim thePacketCounts As New ArrayList()
    Dim thePacketData As New ArrayList()
    Dim aStroke As Microsoft.Ink.Stroke
    For Each aStroke In theStrokes
        If Not InkAnalyzerHelper.AreElementwiseEquivalent( _
            aStroke.PacketDescription, thePacketDescription) Then

            Throw New ApplicationException( _
                "The strokes collection contains strokes with" + _
                "different packet descriptions.")
        End If

        ' Add the stroke data to the collections.
        theStrokeIdentifiers.Add(aStroke.Id)
        thePacketCounts.Add(aStroke.PacketCount)
        thePacketData.AddRange(aStroke.GetPacketData())
    Next aStroke

    ' Update the stroke data for the base layer ink analyzer.
    baseInkAnalyzer.UpdateStrokesData( _
        DirectCast(theStrokeIdentifiers.ToArray(GetType(Integer)), Integer()), _
        DirectCast(thePacketCounts.ToArray(GetType(Integer)), Integer()), _
        DirectCast(thePacketData.ToArray(GetType(Integer)), Integer()), _
        thePacketDescription)

End Sub 'UpdateStrokesData '
/// <summary>
/// Updates the packet data for the specified strokes of an InkAnalyzerBase.
/// </summary>
/// <param name="baseInkAnalyzer">
/// The analyzer that receives the strokes.</param>
/// <param name="theStrokes">
/// The strokes for which to update the stroke data.</param>
/// <remarks>
/// This method converts stroke data to packet data for example only.
/// The InkAnalyzerBase is used when your application is handling packet
/// data. If your application uses stroke data from an Ink object, then
/// you would use InkAnalyzer.
/// </remarks>
public static void MyUpdateStrokesData(
    System.Windows.Ink.AnalysisCore.InkAnalyzerBase baseInkAnalyzer,
    Microsoft.Ink.Strokes theStrokes)
{
    // Check that the parameters are valid
    if (null == baseInkAnalyzer)
    {
        throw new ArgumentNullException("baseInkAnalyzer");
    }

    if (null == theStrokes)
    {
        throw new ArgumentNullException("theStrokes");
    }

    if (0 == theStrokes.Count)
    {
        throw new ArgumentException("Empty strokes collection.");
    }

    // Only strokes that have the same packet description GUIDs
    // can be added in one call to InkAnalyzerBase.AddStrokes.
    Guid[] thePacketDescription = theStrokes[0].PacketDescription;

    // Accumulate the stroke data in collections.
    ArrayList theStrokeIdentifiers = new ArrayList();
    ArrayList thePacketCounts = new ArrayList();
    ArrayList thePacketData = new ArrayList();
    foreach (Microsoft.Ink.Stroke aStroke in theStrokes)
    {
        if (!InkAnalyzerHelper.AreElementwiseEquivalent(
            aStroke.PacketDescription, thePacketDescription))
        {
            throw new ApplicationException(
                "The strokes collection contains strokes with" +
                "different packet descriptions.");
        }

        // Add the stroke data to the collections.
        theStrokeIdentifiers.Add(aStroke.Id);
        thePacketCounts.Add(aStroke.PacketCount);
        thePacketData.AddRange(aStroke.GetPacketData());
    }

    // Update the stroke data for the base layer ink analyzer.
    baseInkAnalyzer.UpdateStrokesData(
        theStrokeIdentifiers.ToArray(typeof(int)) as int[],
        thePacketCounts.ToArray(typeof(int)) as int[],
        thePacketData.ToArray(typeof(int)) as int[],
        thePacketDescription);
}

Plataformas

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

InkAnalyzerBase (Clase)

InkAnalyzerBase (Miembros)

System.Windows.Ink.AnalysisCore (Espacio de nombres)

InkAnalyzerBase.AddStroke

InkAnalyzerBase.AddStrokes

InkAnalyzerBase.ClearStrokeData

InkAnalyzerBase.UpdateStrokeData

InkAnalyzerBase.UpdateStrokesCacheBase