C# Graphics.FillEllipse 方法

来源:互联网 发布:微软软件开发流程 编辑:程序博客网 时间:2024/06/08 17:06

Graphics.FillEllipse 方法 (Brush, Int32, Int32, Int32, Int32)

.NET Framework (current version)
其他版本
 

填充边框所定义的椭圆的内部,该边框由一对坐标、一个宽度和一个高度指定。

命名空间:   System.Drawing
程序集:  System.Drawing(位于 System.Drawing.dll)

语法

C#
C++
F#
VB
public void FillEllipse(Brush brush,int x,int y,int width,int height)

参数

brush
Type: System.Drawing.Brush

确定填充特性的 Brush。

x
Type: System.Int32

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

y
Type: System.Int32

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

width
Type: System.Int32

定义椭圆的边框的宽度。

height
Type: System.Int32

定义椭圆的边框的高度。

异常

ExceptionConditionArgumentNullException

brushnull

备注

此方法填充与的椭圆的内部 Brush。 由该边框由表示定义椭圆 x, ,y, ,width, ,和height 参数。

示例

下面的代码示例仅用于 Windows 窗体,并且它要求在 PaintEventArgse, ,这是一个参数的 Paint 事件处理程序。 该代码执行下列操作:

  • 创建实心的红色画笔。

  • 创建的位置和大小来限定椭圆的矩形。

  • 填充椭圆在屏幕上。

C#
C++
VB
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);}

版本信息

.NET Framework
自 1.1 起可用
0 0
原创粉丝点击