Method: Magick::Image#bounding_box

Defined in:
ext/RMagick/rmimage.cpp

#bounding_boxMagick::Rectangle

Returns the bounding box of an image canvas.

Returns:

  • (Magick::Rectangle)

    the bounding box



2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
# File 'ext/RMagick/rmimage.cpp', line 2215

VALUE
Image_bounding_box(VALUE self)
{
    Image *image;
    RectangleInfo box;
    ExceptionInfo *exception;

    image = rm_check_destroyed(self);
    exception = AcquireExceptionInfo();
    box = GetImageBoundingBox(image, exception);
    CHECK_EXCEPTION();

    DestroyExceptionInfo(exception);

    return Import_RectangleInfo(&box);
}