C#编程-133:绘制椭圆、弧、扇形_彭世瑜_新浪博客
彭世瑜 发布时间:2017-08-20 15:27:51 ,浏览量:1
- using System.Drawing;
- using System.Windows.Forms;
-
- namespace RectangleTest
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
-
- private void Form1_Paint(object sender, PaintEventArgs e)
- {
- Graphics g = e.Graphics;
- Pen pen = new Pen(Color.Orange,3);
- g.DrawRectangle(pen,10,10,100,50);
- g.DrawLine(pen,new Point(10,70) ,new Point(110,70));
-
- //startangle从X轴顺时针方向旋转起始角
- //sweepangle,起始角开始,顺时针方向旋转的角度,单位为度
- g.DrawArc(pen,0,50,200,200,0,180);//绘制弧
-
- g.DrawPie(pen,200,50,200,200,0,90);//绘制扇形
- }
- }
- }
1665367115
查看更多评论