次の方法で共有


InkAnalyzerBase.SetStrokeType メソッド

指定したストロークの型を変更します。

名前空間 :  System.Windows.Ink.AnalysisCore
アセンブリ :  IACore (IACore.dll 内)

構文

'宣言
Public Sub SetStrokeType ( _
    strokeId As Integer, _
    strokeType As StrokeType _
)
'使用
Dim instance As InkAnalyzerBase
Dim strokeId As Integer
Dim strokeType As StrokeType

instance.SetStrokeType(strokeId, strokeType)
public void SetStrokeType(
    int strokeId,
    StrokeType strokeType
)
public:
void SetStrokeType(
    int strokeId, 
    StrokeType strokeType
)
public void SetStrokeType(
    int strokeId,
    StrokeType strokeType
)
public function SetStrokeType(
    strokeId : int, 
    strokeType : StrokeType
)

パラメータ

  • strokeId
    型 : System.Int32
    strokeType を割り当てるストロークのストローク識別子。

解説

ストロークの型が StrokeType 値 Unspecified の場合、インク アナライザはインク分析時にストロークを分類します。それ以外の場合は、アナライザはストロークで設定された型を使用します。

インク アナライザは、ストロークの型の値をインク分析の一部として設定しません。現在ストロークに割り当てられている型を取得するには、GetStrokeType を呼び出します。

ストロークが、未分類インク ノードではないコンテキスト ノードに関連付けられている場合、このメソッドは同じ言語のストロークが含まれる未分類インク ノードにストロークを移動します。そのようなコンテキスト ノードが存在しない場合、このメソッドは新しい未分類インク ノードを作成して、ストロークをそれに追加します。未分類インク ノードは、Type プロパティ値が UnclassifiedInkContextNodeBase です。

このメソッドがストロークを移動する場合、このメソッドはストロークの境界ボックスをインク アナライザの DirtyRegion にも追加します。

strokeType パラメータがストロークの現在の型と一致する場合、このメソッドはストロークを移動しません。

指定したストロークが、インク アナライザに関連付けられていない場合、このメソッドはインク アナライザを更新せずに終了します。

次の例では、指定したストロークの型をチェックし、まだ Unspecified に設定されていない場合は、Unspecified に設定します。InkAnalyzerBase、theInkAnalyzerBase には、ストローク識別子 theStrokeId のストローク データが含まれています。

' If the specified stroke is not set to unspecified,
' Set the stroke's type to unspecified.
Dim theStrokeType As System.Windows.Ink.AnalysisCore.StrokeType = _
    theInkAnalyzerBase.GetStrokeType(theStrokeId)
If System.Windows.Ink.AnalysisCore.StrokeType.Unspecified <> theStrokeType Then
    theInkAnalyzerBase.SetStrokeType( _
        theStrokeId, System.Windows.Ink.AnalysisCore.StrokeType.Unspecified)
End If
// If the specified stroke is not set to unspecified,
// Set the stroke's type to unspecified.
System.Windows.Ink.AnalysisCore.StrokeType theStrokeType =
    theInkAnalyzerBase.GetStrokeType(theStrokeId);
if (System.Windows.Ink.AnalysisCore.StrokeType.Unspecified != theStrokeType)
{
    theInkAnalyzerBase.SetStrokeType(theStrokeId,
        System.Windows.Ink.AnalysisCore.StrokeType.Unspecified);
}

プラットフォーム

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

InkAnalyzerBase クラス

InkAnalyzerBase メンバ

System.Windows.Ink.AnalysisCore 名前空間

InkAnalyzerBase.GetStrokeType

InkAnalyzerBase.SetStrokesType

System.Windows.Ink.AnalysisCore.StrokeType