Share via


Stroke.GetPoint Method

Returns the Point structure at the specified index in a Stroke object.

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

Syntax

'Declaration
Public Function GetPoint ( _
    index As Integer _
) As Point
'Usage
Dim instance As Stroke 
Dim index As Integer 
Dim returnValue As Point 

returnValue = instance.GetPoint(index)
public Point GetPoint(
    int index
)
public:
Point GetPoint(
    int index
)
public function GetPoint(
    index : int
) : Point

Parameters

Return Value

Type: System.Drawing.Point
Returns the Point structure at the specified index in the Stroke object.

Examples

This C# example returns an interpolated point from a Stroke object, theStroke, given as a floating point (Float) index value.

private Point LocatePoint(Stroke theStroke, float theFIndex)
{
    Point ptResult = theStroke.GetPoint((int)theFIndex);
    float theFraction = theFIndex - (int)theFIndex;
    if (theFraction > 0.0f)
    {
        Point ptDelta = theStroke.GetPoint((int)theFIndex + 1);
        ptResult.X += (int)((ptDelta.X - ptResult.X) * theFraction);
        ptResult.Y += (int)((ptDelta.Y - ptResult.Y) * theFraction);
     }
    return ptResult;
}

This Microsoft Visual Basic .NET example returns an interpolated point from a Stroke object, theStroke, given as a floating point (Float) index value.

Private Function LocatePoint( _
ByVal theStroke As Stroke, ByVal theFIndex As Single) As Point
    Dim theIndex As Integer = Math.Floor(theFIndex)
    Dim theFraction As Single = theFIndex - theIndex
    Dim ptResult As Point = theStroke.GetPoint(theIndex)
    If theFraction > 0.0 Then
        Dim ptDelta As Point = theStroke.GetPoint(theIndex + 1)
        ptResult.X += CInt((ptDelta.X - ptResult.X) * theFraction)
        ptResult.Y += CInt((ptDelta.Y - ptResult.Y) * theFraction)
    End If
    Return ptResult
End Function

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

Microsoft.Ink Namespace

Stroke.GetPoints