各位高手,我在读取相应的数据后在panel中画图,但是当它被某个不相关的窗口遮挡(比如qq窗口)或者最小化以后,panel的部分图片就变白了。。怎么样能重新显示panel中的图片呢??
1. 不能在panel3_Paint()函数中写,因为form一运行,paint函数就要运行的。我的数据必须在打开文件后才有,此时还没有送过来。
2. 运行this->panel3->Invalidate(true);后,panel3就干脆直接变白了。。
我是想有没有一个函数或方法直接告诉windows你该重新画panel3的图像了。或者别的解决方法。。

解决方案 »

  1.   

    private: System::Void OpenToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
     if (openFileDialog1->ShowDialog() == Windows::Forms::DialogResult::OK) {
     System::IO::FileInfo^ f_info = gcnew System::IO::FileInfo(openFileDialog1->FileName);
     file_block_num = f_info->Length;
     lines = LineGet(openFileDialog1->FileName);
     array<float,2>^data_s = gcnew array<float,2>( 7,lines-1);
     data_s = DataGet(openFileDialog1->FileName,lines);//获取数据
     DrawSector(data_s,Convert::ToInt32(data_s[0,2]),Convert::ToSingle(data_s[0,0]),Convert::ToSingle(data_s[0,1]));//画图函数
     }
     }
      

  2.   

    这个应该是要在OnPaint()中绘制。用SendMessage(WM_PAINT)吧
      

  3.   


    你就在panel3_Paint()中绘,你可以设一个BOOL变量,没数据的时候就不要绘,有数据了以后再绘。
      

  4.   

    是 vs2008.net CLR 环境
      

  5.   


    让form缩小到一定大小时候,图片不跟着缩放
      

  6.   


    你得在Form_OnSize中调整图片大小