C#画柱状图

时间:2021-04-02 08:28:43
【文件属性】:

文件名称:C#画柱状图

文件大小:1KB

文件格式:CS

更新时间:2021-04-02 08:28:43

C#柱状图

C#画柱状图,可以使用的namespace 柱状图 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Graphics g = this.CreateGraphics(); Pen pen = new Pen(Color.Red, 2); Brush brush = new SolidBrush(Color.Blue); Font font = new Font("宋体", 24); Rectangle rect = new Rectangle(20, 120, 100, 160); g.DrawLine(pen, 20, 100, 100, 100); g.DrawRectangle(pen, rect); g.DrawString("GDI+图形编程", font, brush, 20, 20); brush.Dispose(); font.Dispose(); pen.Dispose(); g.Dispose(); } } }


网友评论