GraphicsPath.AddArc 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将椭圆弧追加到当前图形。
重载
| AddArc(Single, Single, Single, Single, Single, Single) | 
						 将椭圆弧追加到当前图形。  | 
        	
| AddArc(Int32, Int32, Int32, Int32, Single, Single) | 
						 将椭圆弧追加到当前图形。  | 
        	
| AddArc(Rectangle, Single, Single) | 
						 将椭圆弧追加到当前图形。  | 
        	
| AddArc(RectangleF, Single, Single) | 
						 将椭圆弧追加到当前图形。  | 
        	
AddArc(Single, Single, Single, Single, Single, Single)
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
将椭圆弧追加到当前图形。
public:
 void AddArc(float x, float y, float width, float height, float startAngle, float sweepAngle);
	public void AddArc(float x, float y, float width, float height, float startAngle, float sweepAngle);
	member this.AddArc : single * single * single * single * single * single -> unit
	Public Sub AddArc (x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single)
	参数
- x
 - Single
 
矩形区域的左上角的 x 坐标,用于定义从中绘制弧线的椭圆。
- y
 - Single
 
矩形区域的左上角的 y 坐标,用于定义从中绘制弧线的椭圆。
- width
 - Single
 
矩形区域的宽度,用于定义从中绘制弧线的椭圆。
- height
 - Single
 
矩形区域的高度,用于定义从中绘制弧线的椭圆。
- startAngle
 - Single
 
弧的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
 - Single
 
              startAngle 与弧线末尾之间的角度。
示例
有关示例,请参阅 AddArc(Rectangle, Single, Single)。
注解
如果图中有上一条直线或曲线,则会添加一条线,用于将上一段的端点连接到弧线的开头。
弧沿由指定矩形绑定的椭圆的外围进行跟踪。 弧的起点通过开始角度的度数从椭圆的 x 轴(以 0 度角度)顺时针确定。 终结点通过按扫描角度的度数从起点按顺时针测量来定位终结点。 如果扫描角度大于 360 度或小于 -360 度,则弧线将分别横扫 360 度或 -360 度。
适用于
AddArc(Int32, Int32, Int32, Int32, Single, Single)
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
将椭圆弧追加到当前图形。
public:
 void AddArc(int x, int y, int width, int height, float startAngle, float sweepAngle);
	public void AddArc(int x, int y, int width, int height, float startAngle, float sweepAngle);
	member this.AddArc : int * int * int * int * single * single -> unit
	Public Sub AddArc (x As Integer, y As Integer, width As Integer, height As Integer, startAngle As Single, sweepAngle As Single)
	参数
- x
 - Int32
 
矩形区域的左上角的 x 坐标,用于定义从中绘制弧线的椭圆。
- y
 - Int32
 
矩形区域的左上角的 y 坐标,用于定义从中绘制弧线的椭圆。
- width
 - Int32
 
矩形区域的宽度,用于定义从中绘制弧线的椭圆。
- height
 - Int32
 
矩形区域的高度,用于定义从中绘制弧线的椭圆。
- startAngle
 - Single
 
弧的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
 - Single
 
              startAngle 与弧线末尾之间的角度。
示例
有关示例,请参阅 AddArc(Rectangle, Single, Single)。
注解
如果图中有上一条直线或曲线,则会添加一条线,用于将上一段的端点连接到弧线的开头。
弧沿由指定矩形绑定的椭圆的外围进行跟踪。 弧的起点通过开始角度的度数从椭圆的 x 轴(以 0 度角度)顺时针确定。 终结点通过按扫描角度的度数从起点按顺时针测量来定位终结点。 如果扫描角度大于 360 度或小于 -360 度,则弧线将分别横扫 360 度或 -360 度。
适用于
AddArc(Rectangle, Single, Single)
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
将椭圆弧追加到当前图形。
public:
 void AddArc(System::Drawing::Rectangle rect, float startAngle, float sweepAngle);
	public void AddArc(System.Drawing.Rectangle rect, float startAngle, float sweepAngle);
	member this.AddArc : System.Drawing.Rectangle * single * single -> unit
	Public Sub AddArc (rect As Rectangle, startAngle As Single, sweepAngle As Single)
	参数
- startAngle
 - Single
 
弧的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
 - Single
 
              startAngle 与弧线末尾之间的角度。
示例
下面的代码示例旨在与 Windows 窗体一起使用,它需要 PaintEventArgseOnPaint 事件对象。 该代码执行以下操作:
创建一个矩形,从中定义弧线。
创建路径,
myPath。定义一个 180 度的椭圆弧,该弧线从 0 度扫描到 180 度,并将其追加到路径。
绘制屏幕的路径。
private:
   void AddArcExample( PaintEventArgs^ e )
   {
      // Create a GraphicsPath object.
      GraphicsPath^ myPath = gcnew GraphicsPath;
      // Set up and call AddArc, and close the figure.
      Rectangle rect = Rectangle(20,20,50,100);
      myPath->StartFigure();
      myPath->AddArc( rect, 0, 180 );
      myPath->CloseFigure();
      // Draw the path to screen.
      e->Graphics->DrawPath( gcnew Pen( Color::Red,3.0f ), myPath );
   }
private void AddArcExample(PaintEventArgs e)
{
             
    // Create a GraphicsPath object.
    GraphicsPath myPath = new GraphicsPath();
             
    // Set up and call AddArc, and close the figure.
    Rectangle rect = new Rectangle(20, 20, 50, 100);
    myPath.StartFigure();
    myPath.AddArc(rect, 0, 180);
    myPath.CloseFigure();
             
    // Draw the path to screen.
    e.Graphics.DrawPath(new Pen(Color.Red, 3), myPath);
}
Public Sub AddArcExample(ByVal e As PaintEventArgs)
    ' Create a GraphicsPath object.
    Dim myPath As New GraphicsPath
    ' Set up and call AddArc, and close the figure.
    Dim rect As New Rectangle(20, 20, 50, 100)
    myPath.StartFigure()
    myPath.AddArc(rect, 0, 180)
    myPath.CloseFigure()
    ' Draw the path to screen.
    e.Graphics.DrawPath(New Pen(Color.Red, 3), myPath)
End Sub
    	注解
如果图中有上一条直线或曲线,则会添加一条线,用于将上一段的端点连接到弧线的开头。
弧沿由指定矩形绑定的椭圆的外围进行跟踪。 弧的起点通过开始角度的度数从椭圆的 x 轴(以 0 度角度)顺时针确定。 终结点通过按扫描角度的度数从起点按顺时针测量来定位终结点。 如果扫描角度大于 360 度或小于 -360 度,则弧线将分别横扫 360 度或 -360 度。
适用于
AddArc(RectangleF, Single, Single)
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
- Source:
 - GraphicsPath.cs
 
将椭圆弧追加到当前图形。
public:
 void AddArc(System::Drawing::RectangleF rect, float startAngle, float sweepAngle);
	public void AddArc(System.Drawing.RectangleF rect, float startAngle, float sweepAngle);
	member this.AddArc : System.Drawing.RectangleF * single * single -> unit
	Public Sub AddArc (rect As RectangleF, startAngle As Single, sweepAngle As Single)
	参数
- rect
 - RectangleF
 
一个 RectangleF,表示从中获取弧线的椭圆的矩形边界。
- startAngle
 - Single
 
弧的起始角度,以度为单位从 x 轴顺时针测量。
- sweepAngle
 - Single
 
              startAngle 与弧线末尾之间的角度。
示例
有关示例,请参阅 AddArc(Rectangle, Single, Single)。
注解
如果图中有上一条直线或曲线,则会添加一条线,用于将上一段的端点连接到弧线的开头。
弧沿由指定矩形绑定的椭圆的外围进行跟踪。 弧的起点通过开始角度的度数从椭圆的 x 轴(以 0 度角度)顺时针确定。 终结点通过按扫描角度的度数从起点按顺时针测量来定位终结点。 如果扫描角度大于 360 度或小于 -360 度,则弧线将分别横扫 360 度或 -360 度。