InkWordNode 类
表示构成用于形成可识别单词的逻辑分组的笔画集合的 ContextNode。
命名空间: System.Windows.Ink
程序集: IAWinFX(在 IAWinFX.dll 中)
语法
声明
Public NotInheritable Class InkWordNode _
Inherits ContextNode
用法
Dim instance As InkWordNode
public sealed class InkWordNode : ContextNode
public ref class InkWordNode sealed : public ContextNode
public final class InkWordNode extends ContextNode
public final class InkWordNode extends ContextNode
备注
InkWordNode 对象不能包含任何子级。
示例
下面的示例遍历名为 theInkAnalyzer 的 InkAnalyzer 中的所有 InkWordNode 对象,然后绘制显示旋转边界矩形、上行字母线 ascenderLine、下行字母线 descenderLine、中线和基线的线条。这些线条在一个名为 theInkCanvas 的 InkCanvas 上绘制。
' Loop through all of the ink words
Dim inkWords As ContextNodeCollection = _
theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord)
Dim inkWord As InkWordNode
For Each inkWord In inkWords
' Show rotated bounding box in blue
Dim rotatedBounds As New Polygon()
rotatedBounds.Points = inkWord.GetRotatedBoundingBox()
rotatedBounds.Stroke = Brushes.Blue
Me.theInkCanvas.Children.Add(rotatedBounds)
' Show the ascender line in green
Dim ascenderLine As New Polyline()
ascenderLine.Points = inkWord.GetAscender()
ascenderLine.Stroke = Brushes.Green
Me.theInkCanvas.Children.Add(ascenderLine)
' Show the baseline in purple
Dim baseline As New Polyline()
baseline.Points = inkWord.GetBaseline()
baseline.Stroke = Brushes.Purple
theInkCanvas.Children.Add(baseline)
' Show the descender line in yellow
Dim descenderLine As New Polyline()
descenderLine.Points = inkWord.GetDescender()
descenderLine.Stroke = Brushes.Yellow
theInkCanvas.Children.Add(descenderLine)
' Show the descender line in brown
Dim midline As New Polyline()
midline.Points = inkWord.GetMidline()
midline.Stroke = Brushes.Brown
theInkCanvas.Children.Add(midline)
Next inkWord
// Loop through all of the ink words
ContextNodeCollection inkWords =
theInkAnalyzer.FindNodesOfType(ContextNodeType.InkWord);
foreach (InkWordNode inkWord in inkWords)
{
// Show rotated bounding box in blue
Polygon rotatedBounds = new Polygon();
rotatedBounds.Points = inkWord.GetRotatedBoundingBox();
rotatedBounds.Stroke = Brushes.Blue;
this.theInkCanvas.Children.Add(rotatedBounds);
// Show the ascender line in green
Polyline ascenderLine = new Polyline();
ascenderLine.Points = inkWord.GetAscender();
ascenderLine.Stroke = Brushes.Green;
this.theInkCanvas.Children.Add(ascenderLine);
// Show the baseline in purple
Polyline baseline = new Polyline();
baseline.Points = inkWord.GetBaseline();
baseline.Stroke = Brushes.Purple;
theInkCanvas.Children.Add(baseline);
// Show the descender line in yellow
Polyline descenderLine = new Polyline();
descenderLine.Points = inkWord.GetDescender();
descenderLine.Stroke = Brushes.Yellow;
theInkCanvas.Children.Add(descenderLine);
// Show the midline in brown
Polyline midline = new Polyline();
midline.Points = inkWord.GetMidline();
midline.Stroke = Brushes.Brown;
theInkCanvas.Children.Add(midline);
}
继承层次结构
System.Object
System.Windows.Ink.ContextNode
System.Windows.Ink.InkWordNode
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0