private void SelectDetailArea(RubberbandControl p) { SelectedDetailArea = p.DetailArea; textBoxDetailName.Text = SelectedDetailArea.Name; numericUpDownWidth.Value = SelectedDetailArea.Crop.Width; numericUpDownHeight.Value = SelectedDetailArea.Crop.Height; }
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); }
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; } }
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); } }
private void DrawDetails(object sender, ListChangedEventArgs e) { Detail = comboBoxCrop.SelectedItem as DetailArea; pictureBox1.Invalidate(); }