addTextWatermark method

  1. @override
Future<String?> addTextWatermark(
  1. String filePath,
  2. String text,
  3. int x,
  4. int y,
  5. int textSize,
  6. int color,
  7. int? backgroundTextColor,
  8. int quality,
  9. int? backgroundTextPaddingTop,
  10. int? backgroundTextPaddingBottom,
  11. int? backgroundTextPaddingLeft,
  12. int? backgroundTextPaddingRight,
  13. 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,
  int color,
  int? 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,
      'backgroundTextColor': backgroundTextColor,
      'quality': quality,
      'backgroundTextPaddingTop': backgroundTextPaddingTop,
      'backgroundTextPaddingBottom': backgroundTextPaddingBottom,
      'backgroundTextPaddingLeft': backgroundTextPaddingLeft,
      'backgroundTextPaddingRight': backgroundTextPaddingRight,
      'imageFormat': imageFormat.name,
    },
  );
  return result;
}