コード例 #1
0
        protected override void OnUntouchedCore(Point imagePoint)
        {
            touchedPointerStyle = TouchPointerStyle.None;
            touchedPoint        = VisualZoomCropController.TouchPoint.None;
            touchedCell         = new Point(-1, -1);

            if (suspendImageChangedEventOnTouch)
            {
                SourceImage.TriggerImageChanged();
                suspendImageChangedEventOnTouch = false;
            }
            base.OnUntouchedCore(imagePoint);
        }
コード例 #2
0
 protected override void OnTouchedCore(Point imagePoint)
 {
     if (MouseMode == MouseActionMode.Shift)
     {
         base.OnTouchedCore(imagePoint);
     }
     else if (MouseMode == MouseActionMode.Pen)
     {
         suspendImageChangedEventOnTouch = true;
         Pen(CellFromImagePoint(imagePoint));
     }
     else if (MouseMode == MouseActionMode.Fill)
     {
         Fill(CellFromImagePoint(imagePoint));
     }
     else if (MouseMode == MouseActionMode.Select)
     {
         touchedPointerStyle = GetTouchPointerStyleCore(imagePoint);                 // Should be saved calculated first
         touchedPoint        = GetTouchPoint(imagePoint);
         var point = touchedCell = CellFromImagePoint(imagePoint);
         if (point.X >= 0 && point.X < SourceImage.Size.Width && point.Y >= 0 && point.Y < SourceImage.Size.Height)
         {
             if (touchedPoint == VisualZoomCropController.TouchPoint.None || SelectedRect.Width == 0 || SelectedRect.Height == 0)
             {
                 SelectedRect = new Rectangle(point.X, point.Y, 1, 1);
             }
         }
     }
     else if (MouseMode == MouseActionMode.MoveSelection)
     {
         var cellPoint = CellFromImagePoint(imagePoint);
         if (!SelectedRect.ContainsPoint(cellPoint))
         {
             FinishMoveSelection();
         }
         else
         {
             initialTouchImagePoint = cellPoint;
         }
     }
 }