cropImageByRectangle function

CanvasElement? cropImageByRectangle(
  1. CanvasImageSource image,
  2. Rectangle<num>? crop
)

Crops an image using a Rectangle (crop), delegating to method cropImage,

Implementation

CanvasElement? cropImageByRectangle(CanvasImageSource image, Rectangle? crop) {
  if (crop == null) return null;
  return cropImage(image, crop.left as int, crop.top as int, crop.width as int,
      crop.height as int);
}