예제 #1
0
 private void HandleMouseMove(MouseEventArgs e, LinedPictureBox pb)
 {
     if (pbStartImage.Image != null && pbEndImage.Image != null)
     {
         if (_lines.Selected != null &&
             (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right))
         {
             _lines.Selected.Item(_currentLineImageNumber)[_currentLineEnd] = pb.TranslateImageToControl((PointF)e.Location);
             if (_lineCreationInProcess)
             {
                 // if we're creating the line, shape both the start and end line the same
                 _lines.Selected.Item(_currentLineImageNumber ^ 1)[_currentLineEnd] =
                     _lines.Selected.Item(_currentLineImageNumber)[_currentLineEnd];
             }
         }
         pbStartImage.Refresh();
         pbEndImage.Refresh();
     }
 }
예제 #2
0
 private void HandleMouseDown(MouseEventArgs e, LinedPictureBox pb)
 {
     if (pbStartImage.Image != null && pbEndImage.Image != null)
     {
         PointF point = pb.TranslateImageToControl((PointF)e.Location);
         if (e.Button == MouseButtons.Left)
         {
             SetFoundPairAtPoint(pb.ImageNumber, point);
         }
         else
         {
             _lines.Add(Tuple.Create(
                            new Line(point, point),
                            new Line(point, point)));
             _currentLineImageNumber = pb.ImageNumber;
             _currentLineEnd         = 1;
             _lineCreationInProcess  = true;
         }
         pbStartImage.Refresh();
         pbEndImage.Refresh();
     }
 }
예제 #3
0
파일: MainForm.cs 프로젝트: Farouq/semclone
 private void HandleMouseMove(MouseEventArgs e, LinedPictureBox pb)
 {
     if (pbStartImage.Image != null && pbEndImage.Image != null)
     {
         if (_lines.Selected != null &&
             (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right))
         {
             _lines.Selected.Item(_currentLineImageNumber)[_currentLineEnd] = pb.TranslateImageToControl((PointF)e.Location);
             if (_lineCreationInProcess)
             {
                 // if we're creating the line, shape both the start and end line the same
                 _lines.Selected.Item(_currentLineImageNumber ^ 1)[_currentLineEnd] =
                     _lines.Selected.Item(_currentLineImageNumber)[_currentLineEnd];
             }
         }
         pbStartImage.Refresh();
         pbEndImage.Refresh();
     }
 }
예제 #4
0
파일: MainForm.cs 프로젝트: Farouq/semclone
 private void HandleMouseDown(MouseEventArgs e, LinedPictureBox pb)
 {
     if (pbStartImage.Image != null && pbEndImage.Image != null)
     {
         PointF point = pb.TranslateImageToControl((PointF)e.Location);
         if (e.Button == MouseButtons.Left)
         {
             SetFoundPairAtPoint(pb.ImageNumber, point);
         }
         else
         {
             _lines.Add(Tuple.Create(
                 new Line(point, point),
                 new Line(point, point)));
             _currentLineImageNumber = pb.ImageNumber;
             _currentLineEnd = 1;
             _lineCreationInProcess = true;
         }
         pbStartImage.Refresh();
         pbEndImage.Refresh();
     }
 }