1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Graphics g = CreateGraphics(); Pen p = new Pen(Color.Black, 5);//線幅 for (int x = 10; x <= 30; x++) { g.DrawEllipse(p, x * 10, (int)Math.Pow(20-x,2), 5, 5);//x,y,width,height } } } } |