コード例 #1
0
        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;
            }
        }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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();
 }
コード例 #5
0
 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();
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     Pb_frame_.Invalidate();
 }
コード例 #8
0
 private void SetPictureBoxPicture()
 {
     image_width_  = Pb_frame_.Width / 2;
     image_height_ = Pb_frame_.Height / 2;
     Pb_frame_.Invalidate();
 }