InkAnalyzerBase.SetStrokesLanguageId 方法

更改指定笔画的区域设置标识符。

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

语法

声明
Public Sub SetStrokesLanguageId ( _
    strokeIds As Integer(), _
    languageId As Integer _
)
用法
Dim instance As InkAnalyzerBase
Dim strokeIds As Integer()
Dim languageId As Integer

instance.SetStrokesLanguageId(strokeIds, _
    languageId)
public void SetStrokesLanguageId(
    int[] strokeIds,
    int languageId
)
public:
void SetStrokesLanguageId(
    array<int>^ strokeIds, 
    int languageId
)
public void SetStrokesLanguageId(
    int[] strokeIds,
    int languageId
)
public function SetStrokesLanguageId(
    strokeIds : int[], 
    languageId : int
)

参数

  • strokeIds
    类型:array<System.Int32[]
    一个数组,包含要向其分配区域设置标识符的笔画的笔画标识符。
  • languageId
    类型:System.Int32
    要分配给指定笔画的语言标识符。

备注

笔画的区域设置是在通过调用 AddStrokeAddStrokes 添加笔画时设置的。若要获取当前分配给笔画的区域设置,请调用 GetStrokeLanguageId

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

如果此方法从不是未分类墨迹节点的上下文节点移除笔画,则此方法还会将笔画的边界框添加到墨迹分析器的 DirtyRegion

如果 languageId 参数与笔画的当前语言标识符一致,则此方法不移动笔画。

如果 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.AddStroke

InkAnalyzerBase.AddStrokes

InkAnalyzerBase.GetStrokeLanguageId

InkAnalyzerBase.SetStrokeLanguageId