Strokes.Add Method (Strokes)
Adds a Strokes collection to the Strokes collection.
Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Sub Add ( _
strokes As Strokes _
)
'Usage
Dim instance As Strokes
Dim strokes As Strokes
instance.Add(strokes)
public void Add(
Strokes strokes
)
public:
void Add(
Strokes^ strokes
)
public function Add(
strokes : Strokes
)
Parameters
strokes
Type: Microsoft.Ink.Strokes
Remarks
The Stroke object must already exist within the Ink object and cannot belong to another Ink object. In addition, this method does not copy or otherwise alter the Ink object, but merely adds this Stroke to the Strokes collection.
Examples
In this example, a Stroke object is added to a newly created Strokes collection. This collection in turn is added to another Strokes collection. The Ink object passed to the example method is used to create new Strokes collections, and new Stroke objects. When you create a new Stroke object by calling the CreateStroke method, the newly created Stroke is automatically added to the main Strokes collection of the Ink object. In addtion, as shown in this example, the newly created Stroke object can be added to other Strokes collections.
Private Sub AddStrokes(ByVal mInk As Ink)
' create a new Strokes collection
Dim newStrokes1 As Strokes = mInk.CreateStrokes()
' create a new Stroke
Dim points As Point() = {New Point(500, 500), New Point(500, 2500)}
Dim newStroke As Stroke = mInk.CreateStroke(points)
' add the new Stroke to the Strokes collection
newStrokes1.Add(newStroke)
' create another Strokes collection
Dim newStrokes2 As Strokes = mInk.CreateStrokes()
' add the first Strokes collection to the second Strokes collection
newStrokes2.Add(newStrokes1)
End Sub
private void AddStrokes(Ink mInk)
{
// create a new Strokes collection
Strokes newStrokes1 = mInk.CreateStrokes();
// create a new Stroke
Point[] points = { new Point(500, 500), new Point(500, 2500) };
Stroke newStroke = mInk.CreateStroke(points);
// add the new Stroke to the Strokes collection
newStrokes1.Add(newStroke);
// create another Strokes collection
Strokes newStrokes2 = mInk.CreateStrokes();
// add the first Strokes collection to the second Strokes collection
newStrokes2.Add(newStrokes1);
}
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