addImageWatermarkUint8List method
Future<Uint8List?>
addImageWatermarkUint8List(
- Uint8List filePath,
- Uint8List watermarkImagePath,
- int x,
- int y,
- int watermarkWidth,
- int watermarkHeight,
override
Adds an image watermark to the image at the specified location with the given parameters.
Returns a Uint8List representing the watermarked image.
Implementation
@override
Future<Uint8List?> addImageWatermarkUint8List(
Uint8List filePath,
Uint8List watermarkImagePath,
int x,
int y,
int watermarkWidth,
int watermarkHeight,
) async {
final result = await watermarkImageChannel.invokeMethod<String?>(
'addImageWatermark',
{
'filePath': filePath,
'watermarkImagePath': watermarkImagePath,
'x': x,
'y': y,
'watermarkWidth': watermarkWidth,
'watermarkHeight': watermarkHeight,
'quality': 100,
'imageFormat': ImageFormat.png,
},
);
if (result != null) {
final resultBytes = await File(result).readAsBytes();
return resultBytes;
} else {
return null;
}
}