Share via


InkDrawingNode.SetShapeName Method

Adds a new user-defined shape name for the InkDrawingNode.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public Sub SetShapeName ( _
    newShapeName As String _
)
'Usage
Dim instance As InkDrawingNode 
Dim newShapeName As String

instance.SetShapeName(newShapeName)
public void SetShapeName(
    string newShapeName
)
public:
void SetShapeName(
    String^ newShapeName
)
public function SetShapeName(
    newShapeName : String
)

Parameters

Remarks

After a new shape name is set, that string appears as an AnalysisAlternate for the InkDrawingNode. Setting multiple strings creates multiple alternates.

Examples

The following example looks for all the InkDrawingNode objects in an InkAnalyzer, theInkAnalyzer and sets a shape name of "Dot" to those whose Strokes have bounds that are smaller than 200 ink units.

' 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");
    }
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkDrawingNode Class

InkDrawingNode Members

Microsoft.Ink Namespace