Skip to content
Menu
Auto
English

Choose an API

The three public methods share the same output options. Choose by layer type:

Method Use it for Layer order
Marker.markText One or many text watermarks Text array order
Marker.markImage One or many image watermarks Image array order
Marker.mark Text and image watermarks together Exact watermarks array order

markText and markImage remain supported. Use mark when a single render needs both text and image layers or when cross-type ordering matters.

import Marker, { ImageFormat, Position } from 'react-native-image-marker';
const result = await Marker.markText({
backgroundImage: { src: require('./background.jpg') },
watermarkTexts: [
{
text: 'PRIVATE',
position: { position: Position.center },
style: {
color: '#FFFFFF99',
fontSize: 42,
bold: true,
rotate: -18,
},
},
],
saveFormat: ImageFormat.png,
});

Layers render in array order. A later layer is drawn over an earlier one. This is especially important with Marker.mark, where text and image layers share the same array.

Prefer the plural arrays and current position property:

Avoid in new code Use instead
positionOptions on text position
watermarkImage watermarkImages
watermarkPositions position on each image layer
Separate calls for mixed content One Marker.mark call