MarkOptions
此内容尚不支持你的语言。
Defined in: src/index.ts:1116
Options for marking text and image watermarks with a single call.
Example
Section titled “Example”await Marker.mark({ backgroundImage: { src: require('./images/bg.png'), }, watermarks: [ { type: 'text', text: 'hello world', position: { position: Position.bottomCenter, Y: 24, }, style: { color: '#FFFFFF', fontSize: 32, }, }, { type: 'image', src: require('./images/logo.png'), position: { position: Position.topRight, X: 24, Y: 24, }, scale: 0.5, }, ], saveFormat: ImageFormat.png,});Properties
Section titled “Properties”backgroundImage
Section titled “backgroundImage”backgroundImage:
ImageOptions
Defined in: src/index.ts:1120
Background image options.
filename?
Section titled “filename?”
optionalfilename?:string
Defined in: src/index.ts:1141
save image name
matteColor?
Section titled “matteColor?”
optionalmatteColor?:string
Defined in: src/index.ts:1151
Matte color used when an output with transparency is encoded as JPEG.
Default Value
Section titled “Default Value”#FFFFFF
maxSize?
Section titled “maxSize?”
optionalmaxSize?:number
Defined in: src/index.ts:1163
Maximum width or height used while decoding or rendering source images. Larger images keep their aspect ratio on iOS, Android, and Web.
Default Value
Section titled “Default Value”2048quality?
Section titled “quality?”
optionalquality?:number
Defined in: src/index.ts:1137
Integer image quality from 0 to 100, where 100 is best.
Default Value
Section titled “Default Value”100rotationCanvasMode?
Section titled “rotationCanvasMode?”
optionalrotationCanvasMode?:RotationCanvasMode
Defined in: src/index.ts:1157
Controls whether background rotation expands the output canvas or crops back to the original canvas dimensions.
Default Value
Section titled “Default Value”RotationCanvasMode.expandsaveFormat?
Section titled “saveFormat?”
optionalsaveFormat?:ImageFormat
Defined in: src/index.ts:1146
save image format
Default Value
Section titled “Default Value”jpg
watermarkImages?
Section titled “watermarkImages?”
optionalwatermarkImages?:WatermarkImageOptions[]
Defined in: src/index.ts:1132
Image watermark options. Kept for compatibility; use watermarks instead for ordered mixed layers.
watermarks?
Section titled “watermarks?”
optionalwatermarks?:WatermarkLayer[]
Defined in: src/index.ts:1124
Ordered watermark layers. Layers are rendered in array order, so later layers draw over earlier layers.
watermarkTexts?
Section titled “watermarkTexts?”
optionalwatermarkTexts?:TextOptions[]
Defined in: src/index.ts:1128
Text watermark options. Kept for compatibility; use watermarks instead for ordered mixed layers.