Static
markimage url or base64 string
Static
markimage url or base64 string
mark text on image
const options = {
backgroundImage: {
src: require('./images/test.jpg'),
scale: 1,
rotate: 20,
alpha: 0.5,
},
watermarkTexts: [
{
text: 'hello',
positionOptions: {
position: Position.center,
},
style: {
color: '#ff00ff',
fontSize: 30,
fontName: 'Arial',
rotate: 30,
shadowStyle: {
dx: 10,
dy: 10,
radius: 10,
color: '#ffaa22',
},
textBackgroundStyle: {
paddingX: 10,
paddingY: 10,
type: TextBackgroundType.none,
color: '#faaaff',
},
underline: true,
strikeThrough: true,
textAlign: 'left',
italic: true,
bold: true,
},
},
{
text: 'world',
positionOptions: {
X: 10,
Y: 10,
},
style: {
color: '#AAFFDD',
fontSize: 30,
fontName: 'Arial',
rotate: 170,
shadowStyle: {
dx: 10,
dy: 10,
radius: 10,
color: '#ffaa22',
},
textBackgroundStyle: {
paddingX: 10,
paddingY: 10,
type: TextBackgroundType.stretchX,
color: '#faaaff',
},
textAlign: 'right',
skewX: 10,
],
scale: 1,
quality: 100,
filename: 'test',
saveFormat: ImageFormat.png,
};
ImageMarker.markText(options).then((res) => {
console.log(res);
}).catch((err) => {
console.log(err);
});
// or
await ImageMarker.markText(options);
Generated using TypeDoc
Description
mark image on background image
Example