public override void MoveHandle(PointF point, int handleNumber, Keys modifiers) { if (handleNumber == 1) { miniLabel.SetLabel(point); } }
public override void MoveHandle(PointF point, int handleNumber, Keys modifiers) { if (handleNumber == 1) { // User is dragging the outline of the circle, figure out the new radius at this point. float shiftX = Math.Abs(point.X - center.X); float shiftY = Math.Abs(point.Y - center.Y); radius = (int)Math.Sqrt((shiftX * shiftX) + (shiftY * shiftY)); radius = Math.Max(radius, 10); UpdateEllipseInImage(); } else if (handleNumber == 2) { miniLabel.SetLabel(point); UpdateEllipseInImage(); } }
public override void MoveHandle(PointF point, int handleNumber, Keys modifiers) { int constraintAngleSubdivisions = 8; // (Constraint by 45° steps). switch (handleNumber) { case 1: if ((modifiers & Keys.Shift) == Keys.Shift) { points["a"] = GeometryHelper.GetPointAtClosestRotationStepCardinal(points["b"], point, constraintAngleSubdivisions); } else { points["a"] = point; } SignalTrackablePointMoved("a"); break; case 2: if ((modifiers & Keys.Shift) == Keys.Shift) { points["b"] = GeometryHelper.GetPointAtClosestRotationStepCardinal(points["a"], point, constraintAngleSubdivisions); } else { points["b"] = point; } SignalTrackablePointMoved("b"); break; case 3: // Move the center of the mini label to the mouse coord. miniLabel.SetLabel(point); break; } if (CalibrationHelper != null) { CalibrationHelper.CalibrationByLine_Update(Id, points["a"], points["b"]); } }