private void openImage() { if (myImage == null) { myImage = new imageClass(); myImage.readImage(Application.StartupPath + "\\lena.bmp"); } else { openFileDialog1.Filter = "Bitmap Image|*.bmp"; openFileDialog1.FilterIndex = 0; openFileDialog1.Title = "Choose a bit map"; if (openFileDialog1.ShowDialog() == DialogResult.OK) { imageName = openFileDialog1.FileName; myImage.readImage(imageName); } if (openFileDialog1.FileName == "") { return; } } panel.Refresh(); if (histForm != null) { myImage.HistCalculation(); histForm.getIndex = this.myImage; histForm.Refresh(); } if (gTransForm != null) { myImage.HistCalculation(); gTransForm.getIndex = this.myImage; gTransForm.Refresh(); } }