wiImage::crop()
See:
List of operations
Signature
wiImage::crop($left, $top, $width, $height)
Parameters
- $left (int, string): Left coordinate of crop rectangle. Can be an integer or a percent string.
- $top (int, string): Top coordinate of crop rectangle. Can be an integer or a percent string.
- $width (int, string): Width of the crop rectangle. Can be an integer or a percent string.
- $height (int, string): Height of the crop rectangle. Can be an integer or a percent string.
- result (wiTrueColorImage): cropped image
Description
Crops an image to the specified rect. Preserves transparency.
Examples
$img = wiImage::load('/path/to/an/image.png');
// crop at rect (10, 10, 50, 50% of height)
$res = $img->crop(10, 10, 50, '50%');
CategoryDocApi
There are no comments on this page. [Add comment]