指定したストロークのパケット データを更新します。
名前空間 : System.Windows.Ink.AnalysisCore
アセンブリ : IACore (IACore.dll 内)
構文
'宣言
Public Sub UpdateStrokesData ( _
strokeIds As Integer(), _
strokePacketCounts As Integer(), _
strokesPacketData As Integer(), _
strokesPacketDescription As Guid() _
)
'使用
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[]
)
パラメータ
- strokeIds
型 : array<System.Int32[]
ストローク識別子が含まれる配列。
- strokePacketCounts
型 : array<System.Int32[]
各ストローク内のパケットの数が含まれる配列。
- strokesPacketData
型 : array<System.Int32[]
ストロークのパケット データが含まれる配列。
- strokesPacketDescription
型 : array<System.Guid[]
パケット プロパティ識別子が含まれる配列。
解説
strokePacketData には、ストロークのすべてのパケット データが含まれています。strokePacketDescription には、各ストローク内の各ポイントに含まれているパケット データの型を示すグローバル一意識別子 (GUID) が含まれています。使用可能なパケット プロパティの全一覧については、Microsoft.Ink.PacketProperty クラスのトピックを参照してください。
このメソッドは、新しいすべてのストローク データのパケット説明が同じ場合のみ、ストローク データを更新できます。
このメソッドは、インク アナライザの DirtyRegion を更新しません。
strokeIds で識別されたストロークがインク アナライザに関連付けられていない場合、このメソッドは識別子を無視します。
strokeIds で識別されたストロークがどれもインク アナライザに関連付けられたストロークを識別しない場合、このメソッドはインク アナライザを更新せずに終了します。
strokeIds が nullnull 参照 (Visual Basic では Nothing) の場合、このメソッドは System.ArgumentNullException をスローします。
例
次の例では、指定した InkAnalyzerBase のストローク データを更新する UpdateStrokesData メソッドを定義します。このメソッドは、Strokes コレクションをパケット データに変換し、インク アナライザ内のストローク データを更新します。実際には、アプリケーションが Microsoft.Ink.Ink オブジェクトを使用してストローク データを格納している場合、アプリケーションは 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);
}
プラットフォーム
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0
参照
参照
System.Windows.Ink.AnalysisCore 名前空間
InkAnalyzerBase.ClearStrokeData