C# Graphics.FillEllipse 方法

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

定义椭圆的边框的高度。

ExceptionCondition
ArgumentNullException

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
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值