private void pictureBox_OnMouseUp(object sender, MouseEventArgs e) { if (img == null) { return; } if (e.Button == MouseButtons.Left) { if (!SelectedImage) { SelectImageRect = GetSelectImageRect(e.Location); if (!SelectImageRect.IsEmpty) { SelectedImage = true; endPoint_ = e.Location; bottomRight = e.Location; } } else { endPoint_ = e.Location; Pb_frame_.Invalidate(); if (SizeGrip != SizeGrip.None) { selectImageBounds_ = SelectImageRect; } } mouseDown_ = false; } }
private void pictureBox_OnMouseDown(object sender, MouseEventArgs e) { if (img == null) { return; } if (e.Button == MouseButtons.Left) { if (SelectedImage) //已经圈定 { if (SizeGrip != SizeGrip.None) { mouseDown_ = true; mouseDownPoint_ = e.Location; Pb_frame_.Invalidate(); } } else { mouseDown_ = true; mouseDownPoint_ = e.Location; topLeft = e.Location; } } }
public void ToPrePicture() { if (img == null) { return; } if (curPtr == 0) { return; } --curPtr; ResetBoxVar(); image_width_ = Pb_frame_.Width / 2; image_height_ = Pb_frame_.Height / 2; Pb_frame_.Invalidate(); }
public void ToNextPicture() { if (img == null) { return; } if (curPtr >= img.Count - 1) { return; } ++curPtr; ResetBoxVar(); image_width_ = Pb_frame_.Width / 2; image_height_ = Pb_frame_.Height / 2; Pb_frame_.Invalidate(); }
private void Btn_pre_frame_Click(object sender, EventArgs e) { if (img == null) { return; } if (curPtr == 0) { MessageBox.Show("已经是第一张图片"); return; } --curPtr; ResetBoxVar(); image_width_ = Pb_frame_.Width / 2; image_height_ = Pb_frame_.Height / 2; Pb_frame_.Invalidate(); }
private void Btn_next_frame_Click(object sender, EventArgs e) { if (img == null) { return; } if (curPtr >= img.Count - 1) { MessageBox.Show("已经是最后一张图片"); return; } ++curPtr; ResetBoxVar(); image_width_ = Pb_frame_.Width / 2; image_height_ = Pb_frame_.Height / 2; Pb_frame_.Invalidate(); Btn_next_frame_.Enabled = false; }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Pb_frame_.Invalidate(); }
private void SetPictureBoxPicture() { image_width_ = Pb_frame_.Width / 2; image_height_ = Pb_frame_.Height / 2; Pb_frame_.Invalidate(); }