日期:2014-05-18  浏览次数:20805 次

一个关于图片保存的错误。
this.Visible = false;
  System.Threading.Thread.Sleep(200);
  Bitmap bit = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
  Graphics g = Graphics.FromImage(bit);
  g.CopyFromScreen(new Point(0,0),new Point(0,0),bit.Size);
  //SaveFileDialog saveFileDialog = new SaveFileDialog();
  //saveFileDialog.Filter = "bmp|*.bmp|jpg|*.jpg|gif|*.gif";
  //if (saveFileDialog.ShowDialog() != DialogResult.Cancel)
  //{
  // bit.Save(saveFileDialog.FileName);
  //}
  bit.Save("C:\\1.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
  g.Dispose();
  this.Visible = true;
如果不实用saveFiledialog,保存图片时总是说,一个gdi+错误,这个该怎么做啊。

------解决方案--------------------
你的系统是win7吧?你存到别的盘上呢?