private void ImagepictureBox_MouseDown(object sender, MouseEventArgs e) { if (bSizing == null) { bDragging = null; foreach (var el in m_rtList) { Rectangle rt = el.Rect; rt.Inflate(-iMul, -iMul); if (rt.Contains(e.Location)) { bDragging = el; Cursor = iCursorType = Cursors.SizeAll; break; } } } if (bDragging == null) { bSizing = null; foreach (var el in m_rtList) { if (el.Rect.Contains(e.Location)) { iDraggingType = DetectPointOnRect(el.Rect, e.Location); if (iDraggingType >= 1 && iDraggingType <= 8) { bSizing = el; Cursor = iCursorType = GetCursorByType(iDraggingType); break; } } } } pOld = e.Location; }
private void ImagepictureBox_MouseUp(object sender, MouseEventArgs e) { bDragging = null; bSizing = null; }
private void DeleteButton_Click(object sender, EventArgs e) { GrabRect rt = VideopropertyGrid.SelectedObject as GrabRect; m_rtList.Remove(rt); bDragging = null; bSizing = null; VideopropertyGrid.SelectedObject = null; RedrawItems(); }