123456789101112131415161718192021222324252627282930 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsGDIDrawEllipse
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //创建画布
- Graphics graphics = this.CreateGraphics();
- //创建画笔
- Pen myPen = new Pen(Color.Black, 3);
- //绘制椭圆
- graphics.DrawEllipse(myPen, 100, 50, 100, 50);
- }
- }
- }
|