Share via


Stroke.SetPoints Method (array<Point[])

Sets a range of Point structures that starts at the first index in a Stroke object.

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

Syntax

'Declaration
Public Function SetPoints ( _
    points As Point() _
) As Integer
'Usage
Dim instance As Stroke 
Dim points As Point()
Dim returnValue As Integer 

returnValue = instance.SetPoints(points)
public int SetPoints(
    Point[] points
)
public:
int SetPoints(
    array<Point>^ points
)
public function SetPoints(
    points : Point[]
) : int

Parameters

Return Value

Type: System.Int32
Returns the actual number of points set.

Remarks

This method does not change the number of points in the Stroke object. To change the number of points in the Stroke object, a new Stroke object must be created, or the Stroke object must be split.

The length of the points array determines the count of points to be modified in the Stroke object.

This method does not provide for truncating the Stroke object. If the points array contains fewer points than the Stroke object, the remainder of the points in the Stroke object are not modified.

This method does not provide for extending the Stroke object. If the points array contains more points than the Stroke object, the extra points are not used.

Examples

In this example, each selected Stroke object of an InkOverlay is changed into a horizontal stroke by obtaining all the points for the Stroke, and then setting each Y coordinate to match the first Y coordinate of the stroke. Finally, the SetPoints method is used to update the Stroke object.

For Each S As Stroke In mInkOverlay.Selection
    ' get the points 
    Dim pts() As Point = S.GetPoints()
    ' set each Y coordinate to the first Y coordinate 
    For k As Integer = 0 To pts.Length - 1
        pts(k).Y = pts(0).Y
    Next 
    ' update the points
    S.SetPoints(pts)
Next
foreach (Stroke S in mInkOverlay.Selection)
{
    // get the points
    Point[] pts = S.GetPoints();
    // set each Y coordinate to the first Y coordinate 
    for (int k = 0; k < pts.Length; k++)
    {
        pts[k].Y = pts[0].Y;
    }
    // update the points
    S.SetPoints(pts);
}

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

Stroke Class

Stroke Members

SetPoints Overload

Microsoft.Ink Namespace

SetPoints

Stroke.SetPoint