// during pointer motion, select/toggle pictures between initial x/y (param) // and current x/y (get pointer) private void UpdateRubberband() { // determine old and new selection var old_selection = rect_select; selection_end = GetPointer(); var new_selection = BoundedRectangle(selection_start, selection_end); // determine region to invalidate var region = Region.Rectangle(old_selection); region.Xor(Region.Rectangle(new_selection)); region.Shrink(-1, -1); BinWindow.InvalidateRegion(region, true); rect_select = new_selection; UpdateRubberbandSelection(); }