GraphicsPath.AddEllipse 方法

定义

将省略号添加到当前路径。

重载

AddEllipse(Rectangle)

将省略号添加到当前路径。

AddEllipse(RectangleF)

将省略号添加到当前路径。

AddEllipse(Int32, Int32, Int32, Int32)

将省略号添加到当前路径。

AddEllipse(Single, Single, Single, Single)

将省略号添加到当前路径。

AddEllipse(Rectangle)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

将省略号添加到当前路径。

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

参数

rect
Rectangle

一个表示定义椭圆的边界矩形的 Rectangle

示例

下面的代码示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码执行以下操作:

创建定义椭圆的边界矩形。

创建路径并将省略号添加到路径。

绘制屏幕的路径。

private:
   void AddEllipseExample( PaintEventArgs^ e )
   {
      // Create a path and add an ellipse.
      Rectangle myEllipse = Rectangle(20,20,100,50);
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddEllipse( myEllipse );

      // Draw the path to the screen.
      Pen^ myPen = gcnew Pen( Color::Black,2.0f );
      e->Graphics->DrawPath( myPen, myPath );
   }
private void AddEllipseExample(PaintEventArgs e)
{
             
    // Create a path and add an ellipse.
    Rectangle myEllipse = new Rectangle(20, 20, 100, 50);
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddEllipse(myEllipse);
             
    // Draw the path to the screen.
    Pen myPen = new Pen(Color.Black, 2);
    e.Graphics.DrawPath(myPen, myPath);
}
Public Sub AddEllipseExample(ByVal e As PaintEventArgs)

    ' Create a path and add an ellipse.
    Dim myEllipse As New Rectangle(20, 20, 100, 50)
    Dim myPath As New GraphicsPath
    myPath.AddEllipse(myEllipse)

    ' Draw the path to the screen.
    Dim myPen As New Pen(Color.Black, 2)
    e.Graphics.DrawPath(myPen, myPath)
End Sub

适用于

AddEllipse(RectangleF)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

将省略号添加到当前路径。

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

参数

rect
RectangleF

一个表示定义椭圆的边界矩形的 RectangleF

示例

有关示例,请参阅 AddEllipse(Rectangle)

适用于

AddEllipse(Int32, Int32, Int32, Int32)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

将省略号添加到当前路径。

public:
 void AddEllipse(int x, int y, int width, int height);
public void AddEllipse (int x, int y, int width, int height);
member this.AddEllipse : int * int * int * int -> unit
Public Sub AddEllipse (x As Integer, y As Integer, width As Integer, height As Integer)

参数

x
Int32

定义椭圆的边框左上角的 x 坐标。

y
Int32

定义椭圆的边框左上角的 y 坐标。

width
Int32

定义椭圆的边界矩形的宽度。

height
Int32

定义椭圆的边界矩形的高度。

示例

有关示例,请参阅 AddEllipse(Rectangle)

适用于

AddEllipse(Single, Single, Single, Single)

Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs
Source:
GraphicsPath.cs

将省略号添加到当前路径。

public:
 void AddEllipse(float x, float y, float width, float height);
public void AddEllipse (float x, float y, float width, float height);
member this.AddEllipse : single * single * single * single -> unit
Public Sub AddEllipse (x As Single, y As Single, width As Single, height As Single)

参数

x
Single

定义椭圆的边框左上角的 x 坐标。

y
Single

定义椭圆的边框左上角的 y 坐标。

width
Single

定义椭圆的边界矩形的宽度。

height
Single

定义椭圆的边界矩形的高度。

示例

有关示例,请参阅 AddEllipse(Rectangle)

适用于