Stroke.GetPoint 方法

返回 Stroke 对象中位于指定索引处的 Point 结构。

命名空间:  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
返回 Stroke 对象中位于指定索引处的 Point 结构。

示例

此 C# 示例返回 Stroke 对象 theStroke 中指定为浮点 (Float) 索引值的内插点。

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;
}

此 Microsoft Visual Basic .NET 示例返回 Stroke 对象 theStroke 中指定为浮点 (Float) 索引值的内插点。

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