private void button1_Click(object sender, EventArgs e) { //открытие картинки OpenFileDialog open_dialog = new OpenFileDialog(); open_dialog.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*"; if (open_dialog.ShowDialog() == DialogResult.OK) { try { full_name_of_image = open_dialog.FileName; image = new Bitmap(open_dialog.FileName); //this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; Form f = new picture(image); f.Owner = this; f.ShowDialog(); } catch { full_name_of_image = "\0"; DialogResult rezult = MessageBox.Show("Невозможно открыть выбранный файл", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void підтвердитиToolStripMenuItem_Click(object sender, EventArgs e) { picture main = this.Owner as picture; Bitmap bm = new Bitmap(main.pictureBox1.Image); //ваша нвоая картинка Bitmap bm1 = new Bitmap(pictureBox1.Image); //ваша маленькая картинка Graphics g1 = Graphics.FromImage(bm); g1.DrawImage(bm1, param); main.pictureBox1.Image = bm; g1.Dispose(); }
private void підтвердитиToolStripMenuItem_Click(object sender, EventArgs e) { picture.q_saving = true; proverca = false; picture main = this.Owner as picture; picture.stat_rec = picture.zed[0]; Bitmap bm = new Bitmap(main.pictureBox1.Image); //ваша нвоая картинка Bitmap bm1 = new Bitmap(image); //ваша маленькая картинка Graphics g1 = Graphics.FromImage(bm); g1.DrawImage(bm1, picture.zed[0]); main.pictureBox1.Image = bm; g1.Dispose(); }