addTextWatermark method
Future<String?>
addTextWatermark(
- String filePath,
- String text,
- int x,
- int y,
- int textSize,
- Color color,
- Color? backgroundTextColor,
- int quality,
- int? backgroundTextPaddingTop,
- int? backgroundTextPaddingBottom,
- int? backgroundTextPaddingLeft,
- int? backgroundTextPaddingRight,
- ImageFormat imageFormat,
override
Adds a text watermark to the image at the specified location with the given parameters. Use just for IOS or Android. For WEB version you should use addTextWatermarkUint8List()
Returns a String representing the path to the watermarked image.
Implementation
@override
Future<String?> addTextWatermark(
String filePath,
String text,
int x,
int y,
int textSize,
Color color,
Color? backgroundTextColor,
int quality,
int? backgroundTextPaddingTop,
int? backgroundTextPaddingBottom,
int? backgroundTextPaddingLeft,
int? backgroundTextPaddingRight,
ImageFormat imageFormat,
) async {
final result = await watermarkImageChannel.invokeMethod<String?>(
'addTextWatermark',
{
'text': text,
'filePath': filePath,
'x': x,
'y': y,
'textSize': textSize,
'color': color.value.toInt(),
'backgroundTextColor': backgroundTextColor?.value.toInt(),
'quality': quality,
'backgroundTextPaddingTop': backgroundTextPaddingTop,
'backgroundTextPaddingBottom': backgroundTextPaddingBottom,
'backgroundTextPaddingLeft': backgroundTextPaddingLeft,
'backgroundTextPaddingRight': backgroundTextPaddingRight,
'imageFormat': imageFormat.name,
},
);
return result;
}