Skip to main content
RectangleList is a collection of rectangular areas on an image. Use it to add, remove, or clear rectangles in a region.

Methods

Add

Rectangle Add(int left, int top, int right, int bottom);
Rectangle Add(Rectangle rectangle);
Adds a rectangle to the list. Returns the added rectangle.
  • The first overload creates a new rectangle from boundary coordinates.
  • The second overload adds an existing rectangle.

Remove

bool Remove(Rectangle rectangle);
bool Remove(int rectangleIndex);
Removes a rectangle from the list. Returns true if the rectangle was removed, false otherwise.

Clear

void Clear();
Removes all rectangles from the list.