GUI绘图

来源:互联网 发布:c语言课程设计模板 编辑:程序博客网 时间:2024/05/20 08:44
Bitmap bitmap = new Bitmap(panel1.Height,panel1.Width);
Graphics gc = Graphics.FromImage(bitmap);
Pen pen = new Pen(Color.Purple);
gc.DrawRectangle(pen, 0, 0, 40,40);
SolidBrush brush = new SolidBrush(Color.Black);
gc.FillRectangle(brush,0,0,20,20);
PictureBox picture = new PictureBox();
picture.Image = bitmap;
panel1.Controls.Add(picture);
 
0 0
原创粉丝点击