GraphicsPath.Reverse メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GraphicsPath.Reverse メソッドの意味・解説 

GraphicsPath.Reverse メソッド

GraphicsPath の PathPoints 配列内の点の順序反転します。

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

使用例使用例

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

2 番目の点のリストでは、順序最初リスト逆になります

Public Sub GraphicsPathReverseExample(ByVal
 e As PaintEventArgs)

    ' Create a path and add a line, ellipse, and arc.
    Dim myPath As New GraphicsPath
    myPath.AddLine(New Point(0, 0), New Point(100,
 100))
    myPath.AddEllipse(100, 100, 200, 250)
    myPath.AddArc(300, 250, 100, 100, 0, 90)

    ' Draw the first set of points to the screen.
    DrawPointsHelper2(e, myPath.PathPoints, 20)

    ' Call GraphicsPath.Reverse.
    myPath.Reverse()

    ' Draw the reversed set of points to the screen.
    DrawPointsHelper2(e, myPath.PathPoints, 150)
End Sub

' A helper function used by GraphicsPathReverseExample to draw points.
Public Sub DrawPointsHelper2(ByVal
 e As PaintEventArgs, _
ByVal pathPoints() As PointF, ByVal
 xOffset As Integer)
    Dim y As Integer = 20
    Dim myFont As New Font("Arial",
 8)
    Dim i As Integer
    For i = 0 To pathPoints.Length - 1
        e.Graphics.DrawString(pathPoints(i).X.ToString() + _
        ", " + pathPoints(i).Y.ToString(), myFont,
 Brushes.Black, _
        xOffset, y)
        y += 20
    Next i
End Sub
public void GraphicsPathReverseExample(PaintEventArgs
 e)
{
             
    // Create a path and add a line, ellipse, and arc.
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddLine(new Point(0, 0), new Point(100,
 100));
    myPath.AddEllipse(100, 100, 200, 250);
    myPath.AddArc(300, 250, 100, 100, 0, 90);
             
    // Draw the first set of points to the screen.
    DrawPoints2(e, myPath.PathPoints, 20);
             
    // Call GraphicsPath.Reverse.
    myPath.Reverse();
             
    // Draw the reversed set of points to the screen.
    DrawPoints2(e, myPath.PathPoints, 150);
}
//End GraphicsPathReverseExample.
             
// A helper function GraphicsPathReverseExample is used to draw the
             
// points to the screen.
public void DrawPoints2(PaintEventArgs e, PointF[]
 pathPoints, int xOffset)
{
    int y = 20;
    Font myFont = new Font("Arial", 8);
    for(int i=0;i < pathPoints.Length; i++)
    {
        e.Graphics.DrawString(pathPoints[i].X.ToString() + ", " +
            pathPoints[i].Y.ToString(),
            myFont,
            Brushes.Black,
            xOffset,
            y);
        y += 20;
    }
} 
// End DrawPoints
void GraphicsPathReverseExample( PaintEventArgs^ e )
{
   // Create a path and add a line, ellipse, and arc.
   GraphicsPath^ myPath = gcnew GraphicsPath;
   myPath->AddLine( Point(0,0), Point(100,100) );
   myPath->AddEllipse( 100, 100, 200, 250 );
   myPath->AddArc( 300, 250, 100, 100, 0, 90 );

   // Draw the first set of points to the screen.
   DrawPoints2( e, myPath->PathPoints, 20 );

   // Call GraphicsPath.Reverse.
   myPath->Reverse();

   // Draw the reversed set of points to the screen.
   DrawPoints2( e, myPath->PathPoints, 150 );
}

//End GraphicsPathReverseExample.
// A helper function GraphicsPathReverseExample is used to draw the
// points to the screen.
void DrawPoints2( PaintEventArgs^ e, array<PointF>^ pathPoints,
 int xOffset )
{
   int y = 20;
   System::Drawing::Font^ myFont = gcnew System::Drawing::Font( "Arial",8
 );
   for ( int i = 0; i < pathPoints->Length;
 i++ )
   {
      e->Graphics->DrawString( String::Concat( pathPoints[ i ].X, ", ",
 pathPoints[ i ].Y ), myFont, Brushes::Black, (float)xOffset,
 (float)y );
      y += 20;

   }
}
// End DrawPoints
public void GraphicsPathReverseExample(PaintEventArgs
 e)
{
    // Create a path and add a line, ellipse, and arc.
    GraphicsPath myPath = new GraphicsPath();

    myPath.AddLine(new Point(0, 0), new Point(100,
 100));
    myPath.AddEllipse(100, 100, 200, 250);
    myPath.AddArc(300, 250, 100, 100, 0, 90);

    // Draw the first set of points to the screen.
    DrawPoints2(e, myPath.get_PathPoints(), 20);

    // Call GraphicsPath.Reverse.
    myPath.Reverse();

    // Draw the reversed set of points to the screen.
    DrawPoints2(e, myPath.get_PathPoints(), 150);
} //GraphicsPathReverseExample
//End GraphicsPathReverseExample.

// A helper function GraphicsPathReverseExample is used to draw the

// points to the screen.
public void DrawPoints2(PaintEventArgs e, PointF
 pathPoints[], int xOffset)
{
    int y = 20;
    Font myFont = new Font("Arial", 8);

    for (int i = 0; i < pathPoints.length;
 i++) {
        e.get_Graphics().DrawString(System.Convert.ToString(
            pathPoints[i].get_X()) + ", "  
            + System.Convert.ToString(pathPoints[i].get_Y()), myFont, 
            Brushes.get_Black(), xOffset, y);
        y += 20;
    }
} //DrawPoints2
// End DrawPoints
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GraphicsPath クラス
GraphicsPath メンバ
System.Drawing.Drawing2D 名前空間



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

辞書ショートカット

すべての辞書の索引

GraphicsPath.Reverse メソッドのお隣キーワード
検索ランキング

   

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



GraphicsPath.Reverse メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS