Поделиться через


Stroke.GetPoint - метод

Обновлен: Ноябрь 2007

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

Пространство имен:  Microsoft.Ink
Сборка:  Microsoft.Ink (в Microsoft.Ink.dll)

Синтаксис

'Декларация
Public Function GetPoint ( _
    index As Integer _
) As Point
'Применение
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 Point GetPoint(
    int index
)
public function GetPoint(
    index : int
) : Point

Параметры

Возвращаемое значение

Тип: System.Drawing.Point
Returns the Point structure at the specified index in the Stroke object.

Примеры

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

Платформы

Windows Vista

Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.

Сведения о версии

.NET Framework

Поддерживается в версии: 3.0

См. также

Ссылки

Stroke Класс

Stroke - члены

Microsoft.Ink - пространство имен

Stroke.GetPoints