在picturebox上用Graphics绘图后,使用DrawToBitmap进行图片保存,保存下来的都是空白,求解
Bitmap bit = new Bitmap(this.Width, this.Height);
mypanel.DrawToBitmap(bit, Rectangle.FromLTRB(0, 0, this.Width, this.Height));
bit.Save("D:\\a.bmp");
Bitmap bit = new Bitmap(this.Width, this.Height);
mypanel.DrawToBitmap(bit, Rectangle.FromLTRB(0, 0, this.Width, this.Height));
bit.Save("D:\\a.bmp");
{
SizeF z= new SizeF(200, 150);
float fx = this.pictureBox1 .Width / z.Width;
float fy = this.pictureBox1 .Height / z.Height;
e.Graphics.ScaleTransform(fx, fy);
e.Graphics.DrawEllipse(Pens.Blue, new RectangleF(0, 0, sizeF.Width, sizeF.Height));
}