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



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.AddRectangle メソッド (Rectangle)
アセンブリ: System.Drawing (system.drawing.dll 内)


次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub AddRectangleExample(ByVal e As PaintEventArgs) ' Create a GraphicsPath object and add a rectangle to it. Dim myPath As New GraphicsPath Dim pathRect As New Rectangle(20, 20, 100, 200) myPath.AddRectangle(pathRect) ' Draw the path to the screen. Dim myPen As New Pen(Color.Black, 2) e.Graphics.DrawPath(myPen, myPath) End Sub
private void AddRectangleExample(PaintEventArgs e) { // Create a GraphicsPath object and add a rectangle to it. GraphicsPath myPath = new GraphicsPath(); Rectangle pathRect = new Rectangle(20, 20, 100, 200); myPath.AddRectangle(pathRect); // Draw the path to the screen. Pen myPen = new Pen(Color.Black, 2); e.Graphics.DrawPath(myPen, myPath); }
private: void AddRectangleExample( PaintEventArgs^ e ) { // Create a GraphicsPath object and add a rectangle to it. GraphicsPath^ myPath = gcnew GraphicsPath; Rectangle pathRect = Rectangle(20,20,100,200); myPath->AddRectangle( pathRect ); // Draw the path to the screen. Pen^ myPen = gcnew Pen( Color::Black,2.0f ); e->Graphics->DrawPath( myPen, myPath ); }
private void AddRectangleExample(PaintEventArgs e) { // Create a GraphicsPath object and add a rectangle to it. GraphicsPath myPath = new GraphicsPath(); Rectangle pathRect = new Rectangle(20, 20, 100, 200); myPath.AddRectangle(pathRect); // Draw the path to the screen. Pen myPen = new Pen(Color.get_Black(), 2); e.get_Graphics().DrawPath(myPen, myPath); } //AddRectangleExample

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.AddRectangle メソッド
- GraphicsPath.AddRectangle メソッドのページへのリンク