crop method

void crop(
  1. int imageCropX,
  2. int imageCropY,
  3. int imageCropWidth,
  4. int imageCropHeight,
  5. dynamic onImageLoaded(
    1. Image,
    2. Uint8List
    ),
)

Image cropping will be done by crop method

Implementation

void crop(int imageCropX, int imageCropY, int imageCropWidth, int imageCropHeight,
    Function(Library.Image, Uint8List) onImageLoaded) async {
  libraryImage = Library.copyCrop(
    libraryImage,
    x: imageCropX,
    y: imageCropY,
    width: imageCropWidth,
    height: imageCropHeight,
  );

  onImageLoaded.call(libraryImage, Uint8List.fromList(_compressImage(libraryImage)));
}