WatermarkRatio

Position and size of the watermark on the screen.

class WatermarkRatio {
  const WatermarkRatio({this.xRatio, this.yRatio, this.widthRatio});

  @JsonKey(name: 'xRatio')
  final double? xRatio;
  @JsonKey(name: 'yRatio')
  final double? yRatio;
  @JsonKey(name: 'widthRatio')
  final double? widthRatio;
  factory WatermarkRatio.fromJson(Map<String, dynamic> json) =>
      _$WatermarkRatioFromJson(json);
  Map<String, dynamic> toJson() => _$WatermarkRatioToJson(this);
}
The position and size of the watermark on the screen are determined by xRatio, yRatio, and widthRatio:
  • (xRatio, yRatio) specify the coordinates of the top-left corner of the watermark, determining the distance from the top-left corner of the screen.
  • widthRatio determines the width of the watermark.

Properties

xRatio
The x-coordinate of the top-left corner of the watermark. The origin is the top-left corner of the screen. The x-coordinate is the horizontal offset of the watermark's top-left corner relative to the origin. Value range: [0.0, 1.0], default is 0.
yRatio
The y-coordinate of the top-left corner of the watermark. The origin is the top-left corner of the screen. The y-coordinate is the vertical offset of the watermark's top-left corner relative to the origin. Value range: [0.0, 1.0], default is 0.
widthRatio
The width of the watermark. The SDK calculates the proportional height of the watermark based on this value to ensure the image is not distorted when scaled. Value range: [0.0, 1.0], default is 0, meaning the watermark is not displayed.