跳转到内容
菜单
自动
简体中文

TextMarkOptions

此内容尚不支持你的语言。

Defined in: index.ts:587

Options for text watermark

backgroundImage: {
src: require('./images/logo.png'),
scale: 0.5,
rotate: 45,
alpha: 0.5
},
watermarkTexts: [
{
text: 'hello world',
position: {
X: 10,
Y: 10,
// or
// position: Position.center
},
style: {
color: '#aacc22',
fontName: 'Arial',
fontSize: 12,
shadowStyle: {
dx: 10,
dy: 10,
radius: 10,
color: '#aacc22'
},
textBackgroundStyle: {
paddingX: 10,
paddingY: 10,
type: TextBackgroundType.stretchX,
color: '#aacc22'
},
underline: true,
strikeThrough: true,
textAlign: 'left',
italic: true,
//or
// skewX: -0.25,
bold: true,
rotate: 45
}
}],
quality: 100,
filename: 'test',
saveFormat: ImageFormat.jpg,

backgroundImage: ImageOptions

Defined in: index.ts:598

background image options

backgroundImage: {
src: require('./images/logo.png'),
scale: 0.5,
rotate: 45,
alpha: 0.5
}

optional filename?: string

Defined in: index.ts:652

save image name

filename: 'test'

optional matteColor?: string

Defined in: index.ts:668

Matte color used when an output with transparency is encoded as JPEG. JPEG has no alpha channel, so transparent pixels are composited over this color before encoding.

#FFFFFF

matteColor: '#FFFFFF'

optional maxSize?: number

Defined in: index.ts:686

2048
maxSize: 2048

optional quality?: number

Defined in: index.ts:646

Integer image quality from 0 to 100, where 100 is best. Quality has the most visible effect when the output format is jpg. See #159.

100
quality: 100

optional rotationCanvasMode?: RotationCanvasMode

Defined in: index.ts:676

Controls whether background rotation expands the output canvas or crops back to the original canvas dimensions.

RotationCanvasMode.expand
rotationCanvasMode: RotationCanvasMode.crop

optional saveFormat?: ImageFormat

Defined in: index.ts:659

save image format

jpg

saveFormat: ImageFormat.png

watermarkTexts: TextOptions[]

Defined in: index.ts:638

text options

watermarkTexts: [
{
text: 'hello world',
position: {
X: 10,
Y: 10,
// or
// position: Position.center
},
style: {
color: '#aacc22',
fontName: 'Arial',
fontSize: 12,
shadowStyle: {
dx: 10,
dy: 10,
radius: 10,
color: '#aacc22'
},
textBackgroundStyle: {
paddingX: 10,
paddingY: 10,
type: TextBackgroundType.stretchX,
color: '#aacc22'
},
underline: true,
strikeThrough: true,
textAlign: 'left',
italic: true,
//or
// skewX: -0.25,
bold: true,
rotate: 45
}
}]