下面的代码在 windows 窗体内创建一个圆圈。这段代码编译没有任何错误。但它没有画椭圆?!为什么?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Drawing;
namespace WindowsFormsApplication1
{
public class Task1 : Form1
{
public void FillEllipseInt(PaintEventArgs e)
{
SolidBrush redBrush = new SolidBrush(Color.Red);
int x = 100;
int y = 100;
int width = 200;
int height = 100;
e.Graphics.FillEllipse(redBrush, x, y, width, height);
}
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}