GraphicsPath.Flattenとは? わかりやすく解説

GraphicsPath.Flatten メソッド ()


GraphicsPath.Flatten メソッド (Matrix)


GraphicsPath.Flatten メソッド (Matrix, Single)

この GraphicsPath の各曲線を、接続された線分のシーケンスに変換します。

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

使用例使用例

次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードは次のアクションを実行します。

赤い曲線には、点を接続する平坦化された直線があります。

Public Sub FlattenExample(ByVal
 e As PaintEventArgs)
    Dim myPath As New GraphicsPath
    Dim translateMatrix As New
 Matrix
    translateMatrix.Translate(0, 10)
    Dim point1 As New Point(20,
 100)
    Dim point2 As New Point(70,
 10)
    Dim point3 As New Point(130,
 200)
    Dim point4 As New Point(180,
 100)
    Dim points As Point() = {point1, point2,
 point3, point4}
    myPath.AddCurve(points)
    e.Graphics.DrawPath(New Pen(Color.Black, 2), myPath)
    myPath.Flatten(translateMatrix, 10.0F)
    e.Graphics.DrawPath(New Pen(Color.Red, 1), myPath)
End Sub
'FlattenExample
private void FlattenExample(PaintEventArgs
 e)
{
    GraphicsPath myPath = new GraphicsPath();
    Matrix translateMatrix = new Matrix();
    translateMatrix.Translate(0, 10);
    Point point1 = new Point(20, 100);
    Point point2 = new Point(70, 10);
    Point point3 = new Point(130, 200);
    Point point4 = new Point(180, 100);
    Point[] points = {point1, point2, point3, point4};
    myPath.AddCurve(points);
    e.Graphics.DrawPath(new Pen(Color.Black, 2), myPath);
    myPath.Flatten(translateMatrix, 10f);
    e.Graphics.DrawPath(new Pen(Color.Red, 1), myPath);
}
private:
   void FlattenExample( PaintEventArgs^ e )
   {
      GraphicsPath^ myPath = gcnew GraphicsPath;
      Matrix^ translateMatrix = gcnew Matrix;
      translateMatrix->Translate( 0, 10 );
      Point point1 = Point(20,100);
      Point point2 = Point(70,10);
      Point point3 = Point(130,200);
      Point point4 = Point(180,100);
      array<Point>^ points = {point1,point2,point3,point4};
      myPath->AddCurve( points );
      e->Graphics->DrawPath( gcnew Pen( Color::Black,2.0f ), myPath );
      myPath->Flatten( translateMatrix, 10.0f );
      e->Graphics->DrawPath( gcnew Pen( Color::Red,1.0f ), myPath );
   }
private void FlattenExample(PaintEventArgs
 e)
{
    GraphicsPath myPath = new GraphicsPath();
    Matrix translateMatrix = new Matrix();

    translateMatrix.Translate(0, 10);

    Point point1 = new Point(20, 100);
    Point point2 = new Point(70, 10);
    Point point3 = new Point(130, 200);
    Point point4 = new Point(180, 100);
    Point points[] =  { point1, point2, point3, point4 };

    myPath.AddCurve(points);
    e.get_Graphics().DrawPath(new Pen(Color.get_Black(), 2), myPath);
    myPath.Flatten(translateMatrix, 10);
    e.get_Graphics().DrawPath(new Pen(Color.get_Red(), 1), myPath);
} //FlattenExample
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間

GraphicsPath.Flatten メソッド

パスの各曲線を、接続された線分のシーケンスに変換します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
GraphicsPath.Flatten () パスの各曲線を、接続された線分のシーケンスに変換します。
GraphicsPath.Flatten (Matrix) 指定された変換を適用し、GraphicsPath の各曲線を、接続された線分のシーケンスに変換します。
GraphicsPath.Flatten (Matrix, Single) この GraphicsPath の各曲線を、接続された線分のシーケンスに変換します。
参照参照

関連項目

GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「GraphicsPath.Flatten」の関連用語

GraphicsPath.Flattenのお隣キーワード
検索ランキング

   

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



GraphicsPath.Flattenのページの著作権

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

©2026 GRAS Group, Inc.RSS