InkDrawingNode.SetShapeName 方法
为 InkDrawingNode 添加一个新的用户定义的形状名称。
命名空间: System.Windows.Ink
程序集: IAWinFX(在 IAWinFX.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。设置多个字符串会创建多个备选项。
示例
下面的示例在名为 theInkAnalyzer 的 InkAnalyzer 中查找所有 InkDrawingNode 对象,并为边界小于 200 个墨迹单位的 Strokes 的设置形状名称“Dot”。
' Look for all InkDrawing nodes that are very small
Dim inkDrawingNodes As ContextNodeCollection = theInkAnalyzer.FindNodesOfType(ContextNodeType.InkDrawing)
Dim inkDrawing As InkDrawingNode
For Each inkDrawing In inkDrawingNodes
' Check bounding box for size
Dim bounds As Rect = inkDrawing.Strokes.GetBounds()
If bounds.Width < 5 AndAlso bounds.Height < 5 Then
' Set shape name
inkDrawing.SetShapeName("Dot")
End If
Next inkDrawing
// Look for all InkDrawing nodes that are very small
ContextNodeCollection inkDrawingNodes =
theInkAnalyzer.FindNodesOfType(ContextNodeType.InkDrawing);
foreach (InkDrawingNode inkDrawing in inkDrawingNodes)
{
// Check bounding box for size
Rect bounds = inkDrawing.Strokes.GetBounds();
if (bounds.Width < 5 && bounds.Height < 5)
{
// Set shape name
inkDrawing.SetShapeName("Dot");
}
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0