flutter_image_editor
flutter_image_editor copied to clipboard
add text to image
Why my text add only to left top corner? i try change offset: Offset(1, 1),but it do not working .
textOption.addText(
EditorText(
text: '$lat $lng',
fontSizePx: size,
textColor: const Color(0xFF995555),
offset: Offset(1, 1),
),
);
option.outputFormat = const OutputFormat.jpeg(100);
option.addOption(textOption);
Same issue with my app. Please suggest solution
The value of the offset is pixel.
You can try to modify the value of offset to a larger, such as 200x200, or 500x500
Need to calculate the rate then use it on the option, becasue the image size is different the image display on the screen.
textOption.addText(
EditorText(
text: '$lat $lng',
fontSizePx: size,
textColor: const Color(0xFF995555),
offset: Offset(displayWidth* rate, displayHegith*rate),
),
);
option.outputFormat = const OutputFormat.jpeg(100);
option.addOption(textOption);