cropOval method
Completes with an Uint8List of the cropped bytes in an oval shape.
Implementation
@override
Future<Uint8List> cropOval({
required Uint8List bytes,
required int x,
required int y,
required int width,
required int height,
ImageFormat format = ImageFormat.jpg,
}) async {
final arguments = {
'bytes': bytes,
'x': x,
'y': y,
'width': width,
'height': height,
'imageFormat': format.name,
};
try {
final croppedImage =
await _methodChannel.invokeMethod<Uint8List>('cropOval', arguments);
if (croppedImage == null) {
throw const NativeImageCropperException(
'NullPointerException',
'Method channel cropOval() returns null!',
);
}
return croppedImage;
} on PlatformException catch (e) {
throw NativeImageCropperException(e.code, e.message);
}
}