InkDrawingNode.SetShapeName 方法
为 InkDrawingNode 添加一个新的用户定义的形状名称。
命名空间: Microsoft.Ink
程序集: Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.dll 中)
语法
声明
Public Sub SetShapeName ( _
newShapeName As String _
)
用法
Dim instance As InkDrawingNode
Dim newShapeName As String
instance.SetShapeName(newShapeName)
public void SetShapeName(
string newShapeName
)
public:
void SetShapeName(
String^ newShapeName
)
public void SetShapeName(
String newShapeName
)
public function SetShapeName(
newShapeName : String
)
参数
- newShapeName
类型:System.String
形状的名称。
备注
设置新的形状名称之后,该字符串将显示为 InkDrawingNode 的 AnalysisAlternate。设置多个字符串会创建多个备选项。
示例
下面的示例在 InkAnalyzer 对象 theInkAnalyzer 中查找所有 InkDrawingNode 对象,并为 Strokes 边界小于 200 个墨迹单位的对象设置形状名称“Dot”。
' Look for all InkDrawing nodes that are very small
Dim inkDrawingNodes As ContextNodeCollection = _
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkDrawing)
Dim inkDrawing As InkDrawingNode
For Each inkDrawing In inkDrawingNodes
' Check bounding box for size
Dim bounds As Rectangle = inkDrawing.Strokes.GetBoundingBox()
If bounds.Width < 200 And bounds.Height < 200 Then
' Set shape name
inkDrawing.SetShapeName("Dot")
End If
Next inkDrawing
// Look for all InkDrawing nodes that are very small
ContextNodeCollection inkDrawingNodes =
theInkAnalyzer.FindNodesOfType(Microsoft.Ink.ContextNodeType.InkDrawing);
foreach (InkDrawingNode inkDrawing in inkDrawingNodes)
{
// Check bounding box for size
Rectangle bounds = inkDrawing.Strokes.GetBoundingBox();
if (bounds.Width < 200 && bounds.Height < 200)
{
// Set shape name
inkDrawing.SetShapeName("Dot");
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0