InkAnalyzerBase.SetStrokesType 方法

更改指定笔画的类型。

命名空间:  System.Windows.Ink.AnalysisCore
程序集:  IACore(在 IACore.dll 中)

语法

声明
Public Sub SetStrokesType ( _
    strokeIds As Integer(), _
    strokeType As StrokeType _
)
用法
Dim instance As InkAnalyzerBase
Dim strokeIds As Integer()
Dim strokeType As StrokeType

instance.SetStrokesType(strokeIds, strokeType)
public void SetStrokesType(
    int[] strokeIds,
    StrokeType strokeType
)
public:
void SetStrokesType(
    array<int>^ strokeIds, 
    StrokeType strokeType
)
public void SetStrokesType(
    int[] strokeIds,
    StrokeType strokeType
)
public function SetStrokesType(
    strokeIds : int[], 
    strokeType : StrokeType
)

参数

  • strokeIds
    类型:array<System.Int32[]
    一个数组,包含要向其分配 strokeType 的笔画的笔画标识符。

备注

如果笔画的类型为 StrokeType 值 Unspecified,则墨迹分析器在墨迹分析过程中对笔画进行分类。否则,分析器使用在笔画上设置的类型。

墨迹分析器不会将笔画类型值作为墨迹分析的一部分进行设置。若要获取当前分配给笔画的类型,请调用 GetStrokeType

如果某个笔画与不是未分类墨迹节点的上下文节点相关联,则此方法将该笔画移动至包含相同语言的笔画的未分类墨迹节点。如果不存在这样的上下文节点,则此方法创建新的未分类墨迹节点,然后将笔画添加到该节点。未分类墨迹节点是 Type 属性值为 UnclassifiedInkContextNodeBase

如果移动某个笔画,则此方法还将该笔画的边界框添加到墨迹分析器的 DirtyRegion

如果 strokeType 参数与笔画的当前类型一致,则此方法不移动笔画。

如果 strokeIds 中标识的某个笔画不与墨迹分析器相关联,则此方法忽略该标识符。

如果 strokeIds 中标识的任何笔画都不与墨迹分析器相关联,则此方法返回但不更新墨迹分析器。

当 strokeIds 为 nullnull 引用(在 Visual Basic 中为 Nothing) 时,此方法引发 System.ArgumentNullException

示例

下面的示例将指定节点中的所有笔画的笔画类型设置为 StrokeType 值 Writing,并将这些笔画的笔画区域设置设置为“French”。InkAnalyzerBase (theInkAnalyzerBase) 包含指定的 ContextNodeBase (theNode)。

' For all strokes in the specified node or one of its descendants,
' set the stroke type to Writing and the stroke locale to French.
Dim theStrokeIds As Integer() = theNode.GetStrokeIds()
If 0 < theStrokeIds.Length Then
    theInkAnalyzerBase.SetStrokesType( _
        theStrokeIds, System.Windows.Ink.AnalysisCore.StrokeType.Writing)
    theInkAnalyzerBase.SetStrokesLanguageId(theStrokeIds, &H40C)
End If
// For all strokes in the specified node or one of its descendants,
// set the stroke type to Writing and the stroke locale to French.
int[] theStrokeIds = theNode.GetStrokeIds();
if (0 < theStrokeIds.Length)
{
    theInkAnalyzerBase.SetStrokesType(theStrokeIds,
        System.Windows.Ink.AnalysisCore.StrokeType.Writing);
    theInkAnalyzerBase.SetStrokesLanguageId(theStrokeIds, 0x040c);
}

平台

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.SetStrokeType

System.Windows.Ink.AnalysisCore.StrokeType