BoundingRect

Declaration: BoundingRect (Arr: TInt2DArray; var Left, Right, Bottom, Top: integer);
The procedure BoundingRect returns the bounding rectangle of all cells in the matrix Arr which are not zero. The parameters Left, Right, Bottom and Top return the indices of the bounding rectangle. If the array Arr is entirely filled with zeros the returned values are -1 in all four parameters.