示例#1
0
 private void resizeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var myResizeForm = new ResizeImage();
     myResizeForm.SetPicture(pictureBox1.Image, this);
     myResizeForm.ShowDialog();
 }
示例#2
0
 private void Mainform_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 102 || e.KeyChar == 170)
     {
         if (pictureBox1.SizeMode == PictureBoxSizeMode.Zoom)
         {
             pictureBox1.SizeMode = PictureBoxSizeMode.CenterImage;
         }
         else if (pictureBox1.SizeMode == PictureBoxSizeMode.CenterImage)
         {
             pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
         }
     }
     else if (e.KeyChar == 105 || e.KeyChar == 73)
     {
         pictureBox1.Image = ImageManipulation.InvertImage(pictureBox1.Image);
     }
     else if (e.KeyChar == 114 || e.KeyChar == 82)
     {
         var myResizeForm = new ResizeImage();
         myResizeForm.SetPicture(pictureBox1.Image, this);
         myResizeForm.ShowDialog();
     }
     else if (e.KeyChar == 115 || e.KeyChar == 83)
     {
         openToolStripMenuItem_Click(null, null);
     }
     else if (e.KeyChar == 112 || e.KeyChar == 80)
     {
         printDocument1.OriginAtMargins = true;
         printDialog1.Document = printDocument1;
         if (printDialog1.ShowDialog() == DialogResult.OK)
         {
             printDialog1.Document.Print();
         }
     }
 }