Example #1
0
 private void saveProfileToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     using (frmCropProfile profile = new frmCropProfile(currentProfile))
     {
         profile.ShowDialog();
     }
 }
Example #2
0
 private void loadProfileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (frmCropProfile profiles = new frmCropProfile())
     {
         if (profiles.ShowDialog() == DialogResult.OK)
         {
             Size cropSize = new Size(profiles.currentCropProfile.Width,
                 profiles.currentCropProfile.Height);
             if (currentImage != null)
             {
                 currentImage.RemoveCrop();
                 if (currentImage.AddCrop(cropSize))
                 {
                     currentProfile = profiles.currentCropProfile;
                     txtBoundHeight.Text = currentProfile.Height.ToString();
                     txtBoundWidth.Text = currentProfile.Width.ToString();
                     txtDefaultImageDir.Text = currentProfile.ImageDirectory;
                     pen.Color = Color.FromArgb(currentProfile.CropColor);
                     pbxImage.Invalidate();
                 }
                 else
                     MessageBox.Show("You must first enlarge the picture for that crop size.");
             }
             else
             {
                 currentProfile = profiles.currentCropProfile;
                 txtBoundHeight.Text = currentProfile.Height.ToString();
                 txtBoundWidth.Text = currentProfile.Width.ToString();
                 txtDefaultImageDir.Text = currentProfile.ImageDirectory;
                 pen.Color = Color.FromArgb(currentProfile.CropColor);
             }
         }
     }
 }