GraphicsPath.AddRectangle Yöntem

Tanım

Bu yola bir dikdörtgen ekler.

Aşırı Yüklemeler

AddRectangle(RectangleF)

Bu yola bir dikdörtgen ekler.

AddRectangle(Rectangle)

Bu yola bir dikdörtgen ekler.

AddRectangle(RectangleF)

Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs

Bu yola bir dikdörtgen ekler.

public:
 void AddRectangle(System::Drawing::RectangleF rect);
public void AddRectangle (System.Drawing.RectangleF rect);
member this.AddRectangle : System.Drawing.RectangleF -> unit
Public Sub AddRectangle (rect As RectangleF)

Parametreler

rect
RectangleF

RectangleF Eklenecek dikdörtgeni temsil eden bir.

Örnekler

Örnek için bkz. AddRectangle(Rectangle)

Şunlara uygulanır

AddRectangle(Rectangle)

Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs
Kaynak:
GraphicsPath.cs

Bu yola bir dikdörtgen ekler.

public:
 void AddRectangle(System::Drawing::Rectangle rect);
public void AddRectangle (System.Drawing.Rectangle rect);
member this.AddRectangle : System.Drawing.Rectangle -> unit
Public Sub AddRectangle (rect As Rectangle)

Parametreler

rect
Rectangle

Rectangle Eklenecek dikdörtgeni temsil eden bir.

Örnekler

Aşağıdaki kod örneği Windows Forms ile kullanılmak üzere tasarlanmıştır ve bir OnPaint olay nesnesi gerektirir.PaintEventArgse Kod aşağıdaki eylemleri gerçekleştirir:

  • Bir yol oluşturur.

  • Bir dikdörtgen oluşturur ve dikdörtgeni yola ekler.

  • Ekrana giden yolu çizer.

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.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
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

Şunlara uygulanır