Graphics.FillEllipse 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
填充由一對座標、寬度和高度指定的包圍矩形所定義的橢圓內部。
多載
| 名稱 | Description |
|---|---|
| FillEllipse(Brush, Rectangle) |
填充由結構指定的 Rectangle 邊界矩形所定義的橢圓內部。 |
| FillEllipse(Brush, RectangleF) |
填充由結構指定的 RectangleF 邊界矩形所定義的橢圓內部。 |
| FillEllipse(Brush, Int32, Int32, Int32, Int32) |
填充由一對座標、寬度和高度指定的包圍矩形所定義的橢圓內部。 |
| FillEllipse(Brush, Single, Single, Single, Single) |
填充由一對座標、寬度和高度指定的包圍矩形所定義的橢圓內部。 |
FillEllipse(Brush, Rectangle)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
填充由結構指定的 Rectangle 邊界矩形所定義的橢圓內部。
public:
void FillEllipse(System::Drawing::Brush ^ brush, System::Drawing::Rectangle rect);
public void FillEllipse(System.Drawing.Brush brush, System.Drawing.Rectangle rect);
member this.FillEllipse : System.Drawing.Brush * System.Drawing.Rectangle -> unit
Public Sub FillEllipse (brush As Brush, rect As Rectangle)
參數
例外狀況
brush 是 null。
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
這樣可以產生一根實心的紅色刷子。
會形成一個矩形,將橢圓界定。
填滿螢幕上的橢圓。
public:
void FillEllipseRectangle( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );
// Create rectangle for ellipse.
int x = 0;
int y = 0;
int width = 200;
int height = 100;
Rectangle rect = Rectangle(x,y,width,height);
// Fill ellipse on screen.
e->Graphics->FillEllipse( redBrush, rect );
}
public void FillEllipseRectangle(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create rectangle for ellipse.
int x = 0;
int y = 0;
int width = 200;
int height = 100;
Rectangle rect = new Rectangle(x, y, width, height);
// Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, rect);
}
Public Sub FillEllipseRectangle(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create rectangle for ellipse.
Dim x As Integer = 0
Dim y As Integer = 0
Dim width As Integer = 200
Dim height As Integer = 100
Dim rect As New Rectangle(x, y, width, height)
' Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, rect)
End Sub
備註
此方法將橢圓內部填滿 Brush。 該橢圓由由參數 rect 所代表的邊界矩形定義。
適用於
FillEllipse(Brush, RectangleF)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
填充由結構指定的 RectangleF 邊界矩形所定義的橢圓內部。
public:
void FillEllipse(System::Drawing::Brush ^ brush, System::Drawing::RectangleF rect);
public void FillEllipse(System.Drawing.Brush brush, System.Drawing.RectangleF rect);
member this.FillEllipse : System.Drawing.Brush * System.Drawing.RectangleF -> unit
Public Sub FillEllipse (brush As Brush, rect As RectangleF)
參數
- rect
- RectangleF
RectangleF 代表定義橢圓的邊界矩形的結構。
例外狀況
brush 是 null。
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
這樣可以產生一根實心的紅色刷子。
會形成一個矩形,將橢圓界定。
填滿螢幕上的橢圓。
public:
void FillEllipseRectangleF( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );
// Create rectangle for ellipse.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 100.0F;
RectangleF rect = RectangleF(x,y,width,height);
// Fill ellipse on screen.
e->Graphics->FillEllipse( redBrush, rect );
}
public void FillEllipseRectangleF(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create rectangle for ellipse.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 100.0F;
RectangleF rect = new RectangleF(x, y, width, height);
// Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, rect);
}
Public Sub FillEllipseRectangleF(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create rectangle for ellipse.
Dim x As Single = 0.0F
Dim y As Single = 0.0F
Dim width As Single = 200.0F
Dim height As Single = 100.0F
Dim rect As New RectangleF(x, y, width, height)
' Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, rect)
End Sub
備註
此方法將橢圓內部填滿 Brush。 該橢圓由由參數 rect 所代表的邊界矩形定義。
適用於
FillEllipse(Brush, Int32, Int32, Int32, Int32)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
填充由一對座標、寬度和高度指定的包圍矩形所定義的橢圓內部。
public:
void FillEllipse(System::Drawing::Brush ^ brush, int x, int y, int width, int height);
public void FillEllipse(System.Drawing.Brush brush, int x, int y, int width, int height);
member this.FillEllipse : System.Drawing.Brush * int * int * int * int -> unit
Public Sub FillEllipse (brush As Brush, x As Integer, y As Integer, width As Integer, height As Integer)
參數
- x
- Int32
定義橢圓的邊界矩形左上角的 x 座標。
- y
- Int32
定義橢圓的邊界矩形左上角的 y 座標。
- width
- Int32
定義橢圓的邊界矩形寬度。
- height
- Int32
定義橢圓的邊界矩形高度。
例外狀況
brush 是 null。
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
這樣可以產生一根實心的紅色刷子。
建立一個矩形的位置與大小,該矩形界定橢圓。
填滿螢幕上的橢圓。
public:
void FillEllipseInt( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );
// Create location and size of ellipse.
int x = 0;
int y = 0;
int width = 200;
int height = 100;
// Fill ellipse on screen.
e->Graphics->FillEllipse( redBrush, x, y, width, height );
}
public void FillEllipseInt(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create location and size of ellipse.
int x = 0;
int y = 0;
int width = 200;
int height = 100;
// Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, x, y, width, height);
}
Public Sub FillEllipseInt(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create location and size of ellipse.
Dim x As Integer = 0
Dim y As Integer = 0
Dim width As Integer = 200
Dim height As Integer = 100
' Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, x, y, width, height)
End Sub
備註
此方法將橢圓內部填滿 Brush。 該橢圓由由 、 x、 y和 width 參數所代表height的邊界矩形所定義。
適用於
FillEllipse(Brush, Single, Single, Single, Single)
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
- 來源:
- Graphics.cs
填充由一對座標、寬度和高度指定的包圍矩形所定義的橢圓內部。
public:
void FillEllipse(System::Drawing::Brush ^ brush, float x, float y, float width, float height);
public void FillEllipse(System.Drawing.Brush brush, float x, float y, float width, float height);
member this.FillEllipse : System.Drawing.Brush * single * single * single * single -> unit
Public Sub FillEllipse (brush As Brush, x As Single, y As Single, width As Single, height As Single)
參數
- x
- Single
定義橢圓的邊界矩形左上角的 x 座標。
- y
- Single
定義橢圓的邊界矩形左上角的 y 座標。
- width
- Single
定義橢圓的邊界矩形寬度。
- height
- Single
定義橢圓的邊界矩形高度。
例外狀況
brush 是 null。
範例
以下程式碼範例是為 Windows Forms 設計的,並需要 PaintEventArgse,這是 Paint 事件處理程序的參數。 此程式碼會執行下列動作:
這樣可以產生一根實心的紅色刷子。
建立一個矩形的位置與大小,該矩形界定橢圓。
填滿螢幕上的橢圓。
public:
void FillEllipseFloat( PaintEventArgs^ e )
{
// Create solid brush.
SolidBrush^ redBrush = gcnew SolidBrush( Color::Red );
// Create location and size of ellipse.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 100.0F;
// Fill ellipse on screen.
e->Graphics->FillEllipse( redBrush, x, y, width, height );
}
public void FillEllipseFloat(PaintEventArgs e)
{
// Create solid brush.
SolidBrush redBrush = new SolidBrush(Color.Red);
// Create location and size of ellipse.
float x = 0.0F;
float y = 0.0F;
float width = 200.0F;
float height = 100.0F;
// Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, x, y, width, height);
}
Public Sub FillEllipseFloat(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create location and size of ellipse.
Dim x As Single = 0.0F
Dim y As Single = 0.0F
Dim width As Single = 200.0F
Dim height As Single = 100.0F
' Fill ellipse on screen.
e.Graphics.FillEllipse(redBrush, x, y, width, height)
End Sub
備註
此方法將橢圓內部填滿 Brush。 該橢圓由由 、 x、 y和 width 參數所代表height的邊界矩形所定義。