flutter_image_editor icon indicating copy to clipboard operation
flutter_image_editor copied to clipboard

add text to image

Open Hopheylalal opened this issue 4 years ago • 3 comments

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);

Hopheylalal avatar Mar 05 '21 15:03 Hopheylalal

Same issue with my app. Please suggest solution

raksha108 avatar Mar 26 '21 08:03 raksha108

The value of the offset is pixel. You can try to modify the value of offset to a larger, such as 200x200, or 500x500

CaiJingLong avatar Apr 20 '21 09:04 CaiJingLong

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);

huylethanh avatar Nov 16 '21 03:11 huylethanh