Ejemplo n.º 1
0
 private void SelectDetailArea(RubberbandControl p)
 {
     SelectedDetailArea        = p.DetailArea;
     textBoxDetailName.Text    = SelectedDetailArea.Name;
     numericUpDownWidth.Value  = SelectedDetailArea.Crop.Width;
     numericUpDownHeight.Value = SelectedDetailArea.Crop.Height;
 }
Ejemplo n.º 2
0
        private void AddNewRubberbandOnLeftClick(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Left || Photo == null)
            {
                return;
            }

            // initial size and position of the detail area
            var crop = new Rectangle(_pbt.ToImageCoords(e.Location), defaultCropSize);

            var newDetail = new DetailArea()
            {
                Name = "area" + _detailControls.Count, Crop = crop
            };

            Photo.Project.DetailAreas.Add(newDetail);

            var p = new RubberbandControl()
            {
                Location   = e.Location,
                Size       = _pbt.ToScreenCoords(defaultCropSize),
                DetailArea = newDetail
            };

            AddRubberbandControl(p);
        }
Ejemplo n.º 3
0
 private void comboBoxCrop_SelectedValueChanged(object sender, EventArgs e)
 {
     Detail = comboBoxCrop.SelectedItem as DetailArea;
     if (Detail != null)
     {
         numericUpDownHeight.Value = Detail.Crop.Height;
         numericUpDownWidth.Value  = Detail.Crop.Width;
     }
 }
Ejemplo n.º 4
0
 private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Detail = comboBoxCrop.SelectedItem as DetailArea;
     if (Detail != null)
     {
         var pimg = Photo.Image;
         var img  = ImageConverter.Crop(pimg, Detail.Crop);
         pimg.Dispose();
         new ImagePreview(img).Show(this);
     }
 }
Ejemplo n.º 5
0
 private void DrawDetails(object sender, ListChangedEventArgs e)
 {
     Detail = comboBoxCrop.SelectedItem as DetailArea;
     pictureBox1.Invalidate();
 }