private void button_Transform_Click(object sender, EventArgs e) { try { progress_Done = 0; progress_Total = ImageFileNames.Count(); progressForm = new ProgressForm(this); progressForm.SetMaximum(); backgroundWorker2.RunWorkerAsync(); progressForm.ShowDialog(); //dataForm.SetStartPostion(imgForm.Location); //dataForm.Show(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void button_Show_Click(object sender, EventArgs e) { try { ImageSend = new List<Bitmap>(); ImageData = new List<Byte[]>(); ThreadImageSend = new List<Bitmap>[config.ThreadNum]; ThreadImageData = new List<Byte[]>[config.ThreadNum]; Thread _thread = new Thread(ShowThread); GC.Collect(); progress_Done = 0; progress_Total = ImageFileNames.Count(); progressForm = new ProgressForm(this); progressForm.SetMaximum(); ThreadSE(); _thread.Start(); progressForm.ShowDialog(); _thread.Join(); for (int i = 0; i < config.ThreadNum; i++) { ImageSend.AddRange(ThreadImageSend[i]); ImageData.AddRange(ThreadImageData[i]); } imgForm.SetConfig(config); imgForm.ImageRefresh(ImageSend, ImageFileNames); //dataForm.SetStartPostion(imgForm.Location); //dataForm.Show(); imgForm.Show(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }