c# winform 用代码生成一张只有一个像素点的图片,保存到硬盘里或者显示到panel里...

阅读 100

2023-04-27


只生成图片

string nullPath ="C:\\黑色头发.jpg";

Bitmap b = new Bitmap(1,1);

b.Save(nullPath);
b.Dispose();




生成图片并显示到panel里



Bitmap b = new Bitmap(this.panel1.Width, this.panel1.Height);
this.panel1.DrawToBitmap(b, new Rectangle(0, 0, this.panel1.Width, this.panel1.Height));
b.Save("C:\\黑色头发.jpg");




黑色头发:http://heisetoufa.iteye.com/


精彩评论(0)

0 0 举报