private void openButton_Click(object sender, EventArgs e) { using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.Title = "Open Container"; dlg.Filter = "Images|*.jpg;*.bmp;*.png;*.jpeg"; if (dlg.ShowDialog() == DialogResult.OK) { container = Image.FromFile(dlg.FileName); Image tempimg = Image.FromFile(dlg.FileName); originalPictureBox.Image = tempimg; containerAdded = true; containerBitmap = new LockBitmap((Bitmap)container); } } }
private void openImageButton_Click(object sender, EventArgs e) { using (OpenFileDialog dlg = new OpenFileDialog()) { dlg.Title = "Open Container"; dlg.Filter = "Images|*.jpg;*.bmp;*.png;*.jpeg"; if (dlg.ShowDialog() == DialogResult.OK) { img = (Bitmap)Image.FromFile(dlg.FileName); Image tempimg = Image.FromFile(dlg.FileName); imagePictureBox.Image = tempimg; imageAdded = true; imageBitmap = new LockBitmap(img); } } if (containerAdded && imageAdded) { hideButton.Enabled = true; } }