我在加载的时候 加载了几张图片
可是最小化之后 再打开 
就没有了  为什么..?
我是用BitMap 缓存的图片..

解决方案 »

  1.   

    我是在 paint 事件里绘的啊
    还是不行...
      

  2.   

     楼上的几位大哥
     我是刚接触 gdi+ 的
     你们说的 我不是很清楚 能给店实际解决的办法吗..?
      

  3.   

    最小化会引发重绘事件的,你需要在paint事件处理方法里重新绘制。
      

  4.   

    在这里面加载就可以了!
    protected override onpaint(painteventargs e)
    {
      //to do
    }
      

  5.   


    红色换成你的操作就可以了
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace InvoicePrint
    {
        public partial class Form3 : Form
        {
            public Form3()
            {
                InitializeComponent();
            }        private void InitializeComponent()
            {
                this.SuspendLayout();
                // 
                // Form3
                // 
                this.ClientSize = new System.Drawing.Size(945, 552);
                this.Name = "Form3";
                this.ResumeLayout(false);        }        protected override void OnPaint(PaintEventArgs e)
            {              e.Graphics.DrawRectangle(Pens.Blue, new Rectangle(20, 20, 100, 100));        }
        }
    }