如题。
我想把用draw画的图片存储起来怎么办啊?或者,让画好的图片在窗口最小化又恢复后不消失(不能重新再画。在paint事件中的总是重新画,速度太慢)。

解决方案 »

  1.   

    找个函数截屏然后存到某个BMP里吧 目前暂时只想到这一条出路
      

  2.   

    vb.net好象就可以。但我没找到c#的。
    截屏不大好吧
      

  3.   

    public void Get_Img(string a_strUrl, int timeout, string filepath)
    {
          try
          {
                HttpWebRequest request1 = (HttpWebRequest) WebRequest.Create(a_strUrl);
                request1.Timeout = timeout;
                Stream stream1 = ((HttpWebResponse) request1.GetResponse()).GetResponseStream();
                Bitmap bitmap1 = new Bitmap(stream1);
                PictureBox box1 = new PictureBox();
                box1.set_Image(bitmap1);
                string text1 = filepath.Substring(0, filepath.LastIndexOf(@"\"));
                if (!Directory.Exists(text1))
                {
                      this.CreateDir(text1);
                }
                box1.get_Image().Save(filepath);
          }
          catch (Exception exception1)
          {
                string text2 = exception1.Message;
                this.WriteLog(filepath.Substring(0, filepath.LastIndexOf(@"\")) + @"\error.log", a_strUrl + "--" + text2 + "\r\n");
          }

      

  4.   

    注意  box1.get_Image().Save(filepath);看得出思路没有?
      

  5.   

    利用PaintEventArgs参数的ClipRectangle属性来获取剪切区。调用OnPaint()时进行局部重绘。