public PictureForm(PictureForm picture) { InitializeComponent(); bitmap = new Bitmap(picture.bitmap); pictureBox1.Image = bitmap; int height = bitmap.Size.Height; int width = bitmap.Size.Width; pictureBox1.Width = width * 420 / height; }
public HistDiffForm(PictureForm picture) { InitializeComponent(); bitmap = new Bitmap(picture.bitmap); pictureBox1.Image = bitmap; int height = bitmap.Size.Height; int width = bitmap.Size.Width; pictureBox1.Width = width * 420 / height; bmp = new FastBitmap(bitmap); numericUpDownX.Maximum = bmp.Width - 1; numericUpDownY.Maximum = bmp.Height - 1; }
private void duplikujToolStripMenuItem_Click(object sender, EventArgs e) { PictureForm activeChild = (PictureForm)this.ActiveMdiChild; if (activeChild != null) { PictureForm newChild = new PictureForm(activeChild); newChild.Text = new StringBuilder("Obraz ").Append(++formCounter).ToString(); newChild.MdiParent = this; newChild.Show(); } }
private void otwórzToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() != DialogResult.OK) return; PictureForm picture = new PictureForm(this ); picture.MdiParent = this; picture.Text = new StringBuilder("Obraz ").Append(++formCounter).ToString(); picture.loadImage(openFileDialog1.FileName); picture.Show(); }