GraphicsPath.GetBounds メソッド ()
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As GraphicsPath Dim returnValue As RectangleF returnValue = instance.GetBounds
この GraphicsPath に外接する四角形を表す RectangleF。

返された外接する四角形のサイズは、端点キャップの種類、ペンの幅、およびペンのマイタ制限値によって影響を受けるため、境界によって指定されたパスに緩やかに一致します。近似式は、外接する初期の四角形をペン幅で膨らませ、この結果にマイタ制限値を掛け合わせ、端点キャップのための追加の余白を加算します。

次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードは次のアクションを実行します。
右側に外接する四角形の方が (直線の幅が広いことを考慮して) 大きくなります。
Public Sub GetBoundsExample(ByVal e As PaintEventArgs) ' Create path number 1 and a Pen for drawing. Dim myPath As New GraphicsPath Dim pathPen As New Pen(Color.Black, 1) ' Add an Ellipse to the path and Draw it (circle in start ' position). myPath.AddEllipse(20, 20, 100, 100) e.Graphics.DrawPath(pathPen, myPath) ' Get the path bounds for Path number 1 and draw them. Dim boundRect As RectangleF = myPath.GetBounds() e.Graphics.DrawRectangle(New Pen(Color.Red, 1), boundRect.X, _ boundRect.Y, boundRect.Height, boundRect.Width) ' Create a second graphics path and a wider Pen. Dim myPath2 As New GraphicsPath Dim pathPen2 As New Pen(Color.Black, 10) ' Create a new ellipse with a width of 10. myPath2.AddEllipse(150, 20, 100, 100) myPath2.Widen(pathPen2) e.Graphics.FillPath(Brushes.Black, myPath2) ' Get the second path bounds. Dim boundRect2 As RectangleF = myPath2.GetBounds() ' Show the bounds in a message box. e.Graphics.DrawString("Rectangle2 Bounds: " + _ boundRect2.ToString(), New Font("Arial", 8), Brushes.Black, _ 20, 150) ' Draw the bounding rectangle. e.Graphics.DrawRectangle(New Pen(Color.Red, 1), boundRect2.X, _ boundRect2.Y, boundRect2.Height, boundRect2.Width) End Sub
public void GetBoundsExample(PaintEventArgs e) { // Create path number 1 and a Pen for drawing. GraphicsPath myPath = new GraphicsPath(); Pen pathPen = new Pen(Color.Black, 1); // Add an Ellipse to the path and Draw it (circle in start // position). myPath.AddEllipse(20, 20, 100, 100); e.Graphics.DrawPath(pathPen, myPath); // Get the path bounds for Path number 1 and draw them. RectangleF boundRect = myPath.GetBounds(); e.Graphics.DrawRectangle(new Pen(Color.Red, 1), boundRect.X, boundRect.Y, boundRect.Height, boundRect.Width); // Create a second graphics path and a wider Pen. GraphicsPath myPath2 = new GraphicsPath(); Pen pathPen2 = new Pen(Color.Black, 10); // Create a new ellipse with a width of 10. myPath2.AddEllipse(150, 20, 100, 100); myPath2.Widen(pathPen2); e.Graphics.FillPath(Brushes.Black, myPath2); // Get the second path bounds. RectangleF boundRect2 = myPath2.GetBounds(); // Draw the bounding rectangle. e.Graphics.DrawRectangle(new Pen(Color.Red, 1), boundRect2.X, boundRect2.Y, boundRect2.Height, boundRect2.Width); // Display the rectangle size. MessageBox.Show(boundRect2.ToString()); }
public: void GetBoundsExample( PaintEventArgs^ e ) { // Create path number 1 and a Pen for drawing. GraphicsPath^ myPath = gcnew GraphicsPath; Pen^ pathPen = gcnew Pen( Color::Black,1.0f ); // Add an Ellipse to the path and Draw it (circle in start // position). myPath->AddEllipse( 20, 20, 100, 100 ); e->Graphics->DrawPath( pathPen, myPath ); // Get the path bounds for Path number 1 and draw them. RectangleF boundRect = myPath->GetBounds(); e->Graphics->DrawRectangle( gcnew Pen( Color::Red,1.0f ), boundRect.X, boundRect.Y, boundRect.Height, boundRect.Width ); // Create a second graphics path and a wider Pen. GraphicsPath^ myPath2 = gcnew GraphicsPath; Pen^ pathPen2 = gcnew Pen( Color::Black,10.0f ); // Create a new ellipse with a width of 10. myPath2->AddEllipse( 150, 20, 100, 100 ); myPath2->Widen( pathPen2 ); e->Graphics->FillPath( Brushes::Black, myPath2 ); // Get the second path bounds. RectangleF boundRect2 = myPath2->GetBounds(); // Draw the bounding rectangle. e->Graphics->DrawRectangle( gcnew Pen( Color::Red,1.0f ), boundRect2.X, boundRect2.Y, boundRect2.Height, boundRect2.Width ); // Display the rectangle size. MessageBox::Show( boundRect2.ToString() ); }
public void GetBoundsExample(PaintEventArgs e) { // Create path number 1 and a Pen for drawing. GraphicsPath myPath = new GraphicsPath(); Pen pathPen = new Pen(Color.get_Black(), 1); // Add an Ellipse to the path and Draw it (circle in start // position). myPath.AddEllipse(20, 20, 100, 100); e.get_Graphics().DrawPath(pathPen, myPath); // Get the path bounds for Path number 1 and draw them. RectangleF boundRect = myPath.GetBounds(); e.get_Graphics().DrawRectangle(new Pen(Color.get_Red(), 1) , boundRect.get_X(), boundRect.get_Y(), boundRect.get_Height(), boundRect.get_Width()); // Create a second graphics path and a wider Pen. GraphicsPath myPath2 = new GraphicsPath(); Pen pathPen2 = new Pen(Color.get_Black(), 10); // Create a new ellipse with a width of 10. myPath2.AddEllipse(150, 20, 100, 100); myPath2.Widen(pathPen2); e.get_Graphics().FillPath(Brushes.get_Black(), myPath2); // Get the second path bounds. RectangleF boundRect2 = myPath2.GetBounds(); // Draw the bounding rectangle. e.get_Graphics().DrawRectangle(new Pen(Color.get_Red(), 1) , boundRect2.get_X(), boundRect2.get_Y(), boundRect2.get_Height(), boundRect2.get_Width()); // Display the rectangle size. MessageBox.Show(boundRect2.ToString()); } //GetBoundsExample

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


GraphicsPath.GetBounds メソッド (Matrix, Pen)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As GraphicsPath Dim matrix As Matrix Dim pen As Pen Dim returnValue As RectangleF returnValue = instance.GetBounds(matrix, pen)
戻り値
この GraphicsPath に外接する四角形を表す RectangleF。

返された外接する四角形のサイズは、端点キャップの種類、ペンの幅、およびペンのマイタ制限値によって影響を受けるため、境界によって指定されたパスに緩やかに一致します。近似式は、外接する初期の四角形をペン幅で膨らませ、この結果にマイタ制限値を掛け合わせ、端点キャップのための追加の余白を加算します。


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


GraphicsPath.GetBounds メソッド (Matrix)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As GraphicsPath Dim matrix As Matrix Dim returnValue As RectangleF returnValue = instance.GetBounds(matrix)
戻り値
この GraphicsPath に外接する四角形を表す RectangleF。

返された外接する四角形のサイズは、端点キャップの種類、ペンの幅、およびペンのマイタ制限値によって影響を受けるため、境界によって指定されたパスに緩やかに一致します。近似式は、外接する初期の四角形をペン幅で膨らませ、この結果にマイタ制限値を掛け合わせ、端点キャップのための追加の余白を加算します。


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


GraphicsPath.GetBounds メソッド

名前 | 説明 |
---|---|
GraphicsPath.GetBounds () | この GraphicsPath に外接する四角形を返します。 |
GraphicsPath.GetBounds (Matrix) | このパスが指定された Matrix に変換されたときに、この GraphicsPath に外接する四角形を返します。 |
GraphicsPath.GetBounds (Matrix, Pen) | 現在のパスが指定された Matrix によって変換され、指定された Pen で描画されるときに、この GraphicsPath に外接する四角形を返します。 |

Weblioに収録されているすべての辞書からGraphicsPath.GetBoundsを検索する場合は、下記のリンクをクリックしてください。

- GraphicsPath.GetBoundsのページへのリンク