private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { bool noPicture = this.NoPicture; if (!noPicture) { bool isClipCutSelected = this._isClipCutSelected; if (isClipCutSelected) { bool flag = this._selection.Size.Height <= 5 || this._selection.Size.Width <= 5; if (flag) { MessageBox.Show("请重新框选区域。"); return; } FormClipCut formClipCut = new FormClipCut(); bool flag2 = formClipCut.ShowDialog() == DialogResult.OK; if (flag2) { bool flag3 = this._isClipCutSelected && this.pictureBox1.Image != null; if (flag3) { this.pictureBox1.Image = this.pictureBox1.Image.ImgCut(this._selection); this._zoombefore = this.pictureBox1.Image; this.UCCenterImg_CompressSaveFile(); this._isClipCutSelected = false; } } else { this._isClipCutSelected = false; } this._enbleDoImageUndo = true; } bool flag4 = e.Button == MouseButtons.Right && this.pictureBox1.Image != null; if (flag4) { ContextMenu contextMenu = new ContextMenu(); bool flag5 = this._selected && this._selection.ToNormalRectangle().Contains(e.Location); if (flag5) { MenuItem menuItem = new MenuItem("批注"); menuItem.Click += new EventHandler(this.menuNoteitem_Click); contextMenu.MenuItems.Add(menuItem); MenuItem menuItem2 = new MenuItem("框选查看"); menuItem2.Click += new EventHandler(this.menuClipView_Click); contextMenu.MenuItems.Add(menuItem2); bool allowMasaic = FunctionSetting.GetInstance().AllowMasaic; if (allowMasaic) { MenuItem menuItem3 = new MenuItem("马赛克"); menuItem3.Click += new EventHandler(this.MenuMasic_Click); contextMenu.MenuItems.Add(menuItem3); } } contextMenu.Show(this.pictureBox1, e.Location); } } }
private void menuClipCut_Click(object sender, EventArgs e) { bool flag = this._isClipCutSelected && this.pictureBox1.Image != null; if (flag) { FormClipCut formClipCut = new FormClipCut(); this.pictureBox1.Image = this.pictureBox1.Image.ImgCut(this._selection); this._zoombefore = this.pictureBox1.Image; this.UCCenterImg_CompressSaveFile(); this._isClipCutSelected = false; } }