JimmyDaddy / react-native-image-marker

🙈Adding text or icon watermark to your image using React Native👀👀
https://jimmydaddy.github.io/react-native-image-marker/
MIT License
316 stars 93 forks source link

Marker.markText option is not visible #192

Closed karthikkarunanithi91 closed 8 months ago

karthikkarunanithi91 commented 8 months ago

I used "react-native-image-marker": "^1.1.11",

          "react-native": "0.71.3",

![Uploading WhatsApp Image 2024-01-09 at 9.22.50 AM.jpeg…]()

karthikkarunanithi91 commented 8 months ago

My source code is

const options = { // background image backgroundImage: { src: require('../../assets/Image/abtr_centralOffice.png'), scale: 1, }, watermarkTexts: [{ text: 'hellow', positionOptions: { position: Position.topLeft, }, style: { color: '#ff00ff', fontSize: 30, fontName: 'Arial', shadowStyle: { dx: 10, dy: 10, radius: 10, color: '#008F6D', }, textBackgroundStyle: { padding: '10% 10%', type: TextBackgroundType.none, color: '#0FFF00', }, }, }], scale: 1, quality: 100, filename: 'test', saveFormat: ImageFormat.png, }; Marker.markText(options);

JimmyDaddy commented 8 months ago

@karthikkarunanithi91 The image didn't upload successfully. Did you mean that the watermark on the image was invisible?

JimmyDaddy commented 8 months ago

I have tried with your code, but it got correct result

const options = {
  // background image
  backgroundImage: {
    src: require('./bg.png'),
    scale: 1,
  },
  watermarkTexts: [
    {
      text: 'hellow',
      positionOptions: {
        position: Position.topLeft,
      },
      style: {
        color: '#ff00ff',
        fontSize: 30,
        fontName: 'Arial',
        shadowStyle: {
          dx: 10,
          dy: 10,
          radius: 10,
          color: '#008F6D',
        },
        textBackgroundStyle: {
          padding: '10% 10%',
          type: TextBackgroundType.none,
          color: '#0FFF00',
        },
      },
    },
  ],
  scale: 1,
  quality: 100,
  filename: 'test',
  saveFormat: ImageFormat.png,
};
const path = await Marker.markText(options);
截屏2024-01-09 23 18 37