Graphics.TransformPointsとは? わかりやすく解説

Graphics.TransformPoints メソッド (CoordinateSpace, CoordinateSpace, Point[])

この Graphics現在のワールド変換ページ変換使用して、点の配列をある座標空間から別の座標空間変換します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub TransformPoints ( _
    destSpace As CoordinateSpace, _
    srcSpace As CoordinateSpace, _
    pts As Point() _
)
Dim instance As Graphics
Dim destSpace As CoordinateSpace
Dim srcSpace As CoordinateSpace
Dim pts As Point()

instance.TransformPoints(destSpace, srcSpace, pts)
public void TransformPoints (
    CoordinateSpace destSpace,
    CoordinateSpace srcSpace,
    Point[] pts
)
public:
void TransformPoints (
    CoordinateSpace destSpace, 
    CoordinateSpace srcSpace, 
    array<Point>^ pts
)
public void TransformPoints (
    CoordinateSpace destSpace, 
    CoordinateSpace srcSpace, 
    Point[] pts
)
public function TransformPoints (
    destSpace : CoordinateSpace, 
    srcSpace : CoordinateSpace, 
    pts : Point[]
)

パラメータ

destSpace

変換先の座標空間指定する CoordinateSpace 列挙体のメンバ

srcSpace

変換元の座標空間指定する CoordinateSpace 列挙体のメンバ

pts

変換する点を表す Point 構造体配列

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

青の直線と、その下に平行移動した赤の直線生成されます。

Public Sub TransformPointsPoint(ByVal
 e As PaintEventArgs)

    ' Create array of two points.
    Dim points As Point() = {New Point(0, 0),
 New Point(100, 50)}

    ' Draw line connecting two untransformed points.
    e.Graphics.DrawLine(New Pen(Color.Blue, 3), points(0), points(1))

    ' Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40, 30)

    ' Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, _
    CoordinateSpace.World, points)

    ' Reset world transformation.
    e.Graphics.ResetTransform()

    ' Draw line that connects transformed points.
    e.Graphics.DrawLine(New Pen(Color.Red, 3), points(0), points(1))
End Sub
public void TransformPointsPoint(PaintEventArgs
 e)
{

    // Create array of two points.
    Point[] points = { new Point(0, 0), new
 Point(100, 50) };

    // Draw line connecting two untransformed points.
    e.Graphics.DrawLine(new Pen(Color.Blue, 3), points[0], points[1]);

    // Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40, 30);

    // Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.World, points);

    // Reset world transformation.
    e.Graphics.ResetTransform();

    // Draw line that connects transformed points.
    e.Graphics.DrawLine(new Pen(Color.Red, 3), points[0], points[1]);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.TransformPoints メソッド (CoordinateSpace, CoordinateSpace, PointF[])

この Graphics現在のワールド変換ページ変換使用して、点の配列をある座標空間から別の座標空間変換します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub TransformPoints ( _
    destSpace As CoordinateSpace, _
    srcSpace As CoordinateSpace, _
    pts As PointF() _
)
Dim instance As Graphics
Dim destSpace As CoordinateSpace
Dim srcSpace As CoordinateSpace
Dim pts As PointF()

instance.TransformPoints(destSpace, srcSpace, pts)
public void TransformPoints (
    CoordinateSpace destSpace,
    CoordinateSpace srcSpace,
    PointF[] pts
)
public:
void TransformPoints (
    CoordinateSpace destSpace, 
    CoordinateSpace srcSpace, 
    array<PointF>^ pts
)
public void TransformPoints (
    CoordinateSpace destSpace, 
    CoordinateSpace srcSpace, 
    PointF[] pts
)
public function TransformPoints (
    destSpace : CoordinateSpace, 
    srcSpace : CoordinateSpace, 
    pts : PointF[]
)

パラメータ

destSpace

変換先の座標空間指定する CoordinateSpace 列挙体のメンバ

srcSpace

変換元の座標空間指定する CoordinateSpace 列挙体のメンバ

pts

変換する点を表す PointF 構造体配列

使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

青の直線と、その下に平行移動した赤の直線生成されます。

Public Sub TransformPointsPointF(ByVal
 e As PaintEventArgs)

    ' Create array of two points.
    Dim points As PointF() = {New PointF(0.0F,
 0.0F), New PointF(100.0F, _
    50.0F)}

    ' Draw line connecting two untransformed points.
    e.Graphics.DrawLine(New Pen(Color.Blue, 3), points(0), points(1))

    ' Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40.0F, 30.0F)

    ' Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, _
    CoordinateSpace.World, points)

    ' Reset world transformation.
    e.Graphics.ResetTransform()

    ' Draw line that connects transformed points.
    e.Graphics.DrawLine(New Pen(Color.Red, 3), points(0), points(1))
End Sub
public void TransformPointsPointF(PaintEventArgs
 e)
{

    // Create array of two points.
    PointF[] points = { new PointF(0.0F, 0.0F), new
 PointF(100.0F, 50.0F) };

    // Draw line connecting two untransformed points.
    e.Graphics.DrawLine(new Pen(Color.Blue, 3), points[0], points[1]);

    // Set world transformation of Graphics object to translate.
    e.Graphics.TranslateTransform(40.0F, 30.0F);

    // Transform points in array from world to page coordinates.
    e.Graphics.TransformPoints(CoordinateSpace.Page, CoordinateSpace.World, points);

    // Reset world transformation.
    e.Graphics.ResetTransform();

    // Draw line that connects transformed points.
    e.Graphics.DrawLine(new Pen(Color.Red, 3), points[0], points[1]);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.TransformPoints メソッド



このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphics.TransformPointsを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphics.TransformPointsを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphics.TransformPoints を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Graphics.TransformPoints」の関連用語

Graphics.TransformPointsのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Graphics.TransformPointsのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS