TextMarkOptions
此内容尚不支持你的语言。
Defined in: src/index.ts:772
Options for text watermark
Example
Section titled “Example”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,Properties
Section titled “Properties”backgroundImage
Section titled “backgroundImage”backgroundImage:
ImageOptions
Defined in: src/index.ts:783
background image options
Example
Section titled “Example”backgroundImage: { src: require('./images/logo.png'), scale: 0.5, rotate: 45, alpha: 0.5}filename?
Section titled “filename?”
optionalfilename?:string
Defined in: src/index.ts:837
save image name
Example
Section titled “Example”filename: 'test'matteColor?
Section titled “matteColor?”
optionalmatteColor?:string
Defined in: src/index.ts:853
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.
Default Value
Section titled “Default Value”#FFFFFF
Example
Section titled “Example”matteColor: '#FFFFFF'maxSize?
Section titled “maxSize?”
optionalmaxSize?:number
Defined in: src/index.ts:869
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”2048Example
Section titled “Example”maxSize: 2048quality?
Section titled “quality?”
optionalquality?:number
Defined in: src/index.ts:831
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.
Default Value
Section titled “Default Value”100Example
Section titled “Example”quality: 100rotationCanvasMode?
Section titled “rotationCanvasMode?”
optionalrotationCanvasMode?:RotationCanvasMode
Defined in: src/index.ts:861
Controls whether background rotation expands the output canvas or crops back to the original canvas dimensions.
Default Value
Section titled “Default Value”RotationCanvasMode.expandExample
Section titled “Example”rotationCanvasMode: RotationCanvasMode.cropsaveFormat?
Section titled “saveFormat?”
optionalsaveFormat?:ImageFormat
Defined in: src/index.ts:844
save image format
Default Value
Section titled “Default Value”jpg
Example
Section titled “Example”saveFormat: ImageFormat.pngwatermarkTexts
Section titled “watermarkTexts”watermarkTexts:
TextOptions[]
Defined in: src/index.ts:823
text options
Example
Section titled “Example”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 }}]