private void btnLoadBMP_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Bitmap|*.bmp"; if (ofd.ShowDialog() == DialogResult.OK) { inputFilePathEncoder = ofd.FileName; fileReaderObject = Helpers.ReadBmpFormat(inputFilePathEncoder, false); pictureBoxOriginalImage.Image = fileReaderObject.GetBmpImage(); BmpWvlFileObject.auxImage = fileReaderObject.GetBmpData(); waveletImage = fileReaderObject.GetBmpFloatData(); pictureBoxWaveletImage.Image = Helpers.BuildBitmapFromMatrix(waveletImage); } }
private void btnRefresh_Click(object sender, EventArgs e) { try { if (fileReaderObject == null) { throw new NullReferenceException(); } waveletImage = fileReaderObject.GetBmpFloatData(); numericUpDownX.Value = numericUpDownX.Maximum; numericUpDownY.Value = numericUpDownY.Maximum; pictureBoxWaveletImage.Image = Helpers.BuildBitmapFromMatrix(waveletImage); } catch (NullReferenceException) { MessageBox.Show("Warning: You forgot to load image first!"); } }