次の方法で共有


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

パラメータ

  • index
    型 : System.Int32
    返す Point 構造体の 0 から始まるインデックス。

戻り値

型 : 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