private void LayoutBlockBindingSource_CurrentChanged(object sender, EventArgs e) { if (PictureBox.Image == null) { return; } if (CurrentLayoutBlock != null) { CurrentDisplayBlock.SetRect(CurrentLayoutBlock.GetRect()); } }
private void LoadImageToolStripMenuItem_Click(object sender, EventArgs e) { if (ImageOpenFileDialog.ShowDialog() != DialogResult.OK) { return; } var image = Image.FromFile(ImageOpenFileDialog.FileName); PictureBox.Image = image; PictureBox.Width = image.Width; PictureBox.Height = image.Height; CurrentDisplayBlock.SetRect(CurrentLayoutBlock.GetRect()); }