移动检测区
This commit is contained in:
@@ -431,6 +431,7 @@ namespace Camera
|
||||
{
|
||||
_isMoving = true;
|
||||
_startPoint = imagePoint;
|
||||
_resizeStartPoint = controlPoint;
|
||||
_originalZone = _isEditingDetectionZone ? detectionZone : ledZone;
|
||||
}
|
||||
}
|
||||
@@ -441,6 +442,7 @@ namespace Camera
|
||||
_selectedZoneIndex = 0;
|
||||
_isMoving = true;
|
||||
_startPoint = imagePoint;
|
||||
_resizeStartPoint = controlPoint;
|
||||
_originalZone = detectionZone;
|
||||
}
|
||||
else if (ledZone.Contains(imagePoint))
|
||||
@@ -448,6 +450,7 @@ namespace Camera
|
||||
_selectedZoneIndex = 1;
|
||||
_isMoving = true;
|
||||
_startPoint = imagePoint;
|
||||
_resizeStartPoint = controlPoint;
|
||||
_originalZone = ledZone;
|
||||
}
|
||||
else
|
||||
@@ -584,14 +587,12 @@ namespace Camera
|
||||
{
|
||||
picBoxCamera.Cursor = Cursors.SizeAll;
|
||||
|
||||
Point imagePoint = new Point((int)(e.Location.X / scaleX), (int)(e.Location.Y / scaleY));
|
||||
|
||||
int dx = imagePoint.X - _startPoint.X;
|
||||
int dy = imagePoint.Y - _startPoint.Y;
|
||||
int dx = e.Location.X - _resizeStartPoint.X;
|
||||
int dy = e.Location.Y - _resizeStartPoint.Y;
|
||||
|
||||
Rectangle newZone = new Rectangle(
|
||||
_originalZone.X + dx,
|
||||
_originalZone.Y + dy,
|
||||
_originalZone.X + (int)(dx / scaleX),
|
||||
_originalZone.Y + (int)(dy / scaleY),
|
||||
_originalZone.Width,
|
||||
_originalZone.Height
|
||||
);
|
||||
@@ -611,7 +612,7 @@ namespace Camera
|
||||
}
|
||||
|
||||
UpdateDataGridView();
|
||||
picBoxCamera.Invalidate();
|
||||
picBoxCamera.Update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user