private void btnGenerate_Click(object sender, EventArgs e) { if (dlgGenerateReference.ShowDialog() == DialogResult.OK) { //create the in-memory image try { referenceImage = new Graphics.ReferenceImage((int)numDimension.Value, (int)numBlockSize.Value); } catch (Exception exception) { showError("There was a problem creating the reference image: " + exception.Message); return; } //save to disk try { referenceImage.Save(dlgGenerateReference.FileName); } catch (Exception exception) { showError("There was a problem saving the reference image: " + exception.Message); return; } //sync the controls syncControlsToImage(); } }
private void btnLoad_Click(object sender, EventArgs e) { if (dlgLoadReference.ShowDialog() == DialogResult.OK) { //load the image into memory try { referenceImage = new Graphics.ReferenceImage(dlgLoadReference.FileName); } catch (Exception exception) { showError("There was a problem loading the reference image: " + exception.Message); return; } //sync the controls syncControlsToImage(); } }