}. pictureBox1.Refresh (); ();
}
private void PasteToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; .UpdateOldImage (); (var graphics=Graphics.FromImage (form1.pictureBox1.Image))
{. DrawImage (form1.buffer, form1.startPoint);
}. pictureBox1.Refresh (); ();
}
private void повернутьНа90ГрToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; buf1=form1.pictureBox1.Image as Bitmap; .buffer=buf1.Clone (new Rectangle (form1.startPoint, Size), buf1.PixelFormat) ;. buffer.RotateFlip (RotateFlipType.Rotate90FlipNone) ;. UpdateOldImage (); (var graphics=Graphics.FromImage (form1.pictureBox1.Image))
{. FillRectangle (new SolidBrush (Color.White), new Rectangle (form1.startPoint, Size)) ;. DrawImage (form1.buffer, form1.startPoint);
}. pictureBox1.Refresh (); ();
}
private void повернутьНа90ГрадусовВлевоToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; buf1=form1.pictureBox1.Image as Bitmap; .buffer=buf1.Clone (new Rectangle (form1.startPoint, Size), buf1.PixelFormat) ;. buffer.RotateFlip (RotateFlipType.Rotate270FlipNone) ;. UpdateOldImage (); (var graphics=Graphics.FromImage (form1.pictureBox1.Image))
{. FillRectangle (new SolidBrush (Color.White), new Rectangle (form1.startPoint, Size)) ;. DrawImage (form1.buffer, form1.startPoint);
}. pictureBox1.Refresh (); ();
}
private void обратітьЦветаToolStripMenuItem_Click (object sender, EventArgs e)
{= Owner as MainForm; buf1=form1.pictureBox1.Image as Bitmap; .buffer=buf1.Clone (new Rectangle(form1.startPoint, Size), buf1.PixelFormat) ;. UpdateOldImage (); (var graphics=Graphics.FromImage (form1.pictureBox1.Image))
{. DrawImage (form1.Generate_negative_image (form1.buffer), form1.startPoint);
}. pictureBox1.Refresh (); ();
}
}
Клас NewForm
partial class NewForm: Form
{MainForm form1; NewForm ()
{();
} void Form3_Load (object sender, EventArgs e)
{= Owner as MainForm;
} void button1_Click (object sender, EventArgs e)
{= Owner as MainForm; x1=(int) numericUpDown1.Value; y1=(int) numericUpDown2.Value; image=new Bitmap (x1, y1); g=Graphics.FromImage (image) ; .Clear (Color.White) ;. Dispose (); p=Owner.Controls [ panel1 ]. Controls [ pictureBox1 ] as PictureBox; (p.Image!=null) .Image.Dispose () ; .Image=image; ();
} void button2_Click (object sender, EventArgs e)
{= Owner as MainForm; ();
}
}