Lavorare con il Watermark
Contents
[
Hide
]Aggiungi Watermark in un DGN
A volte desideri aggiungere dei watermark ai disegni per indicare a quale scopo servono o chi li ha creati. Aspose.CAD per Python ti consente di aggiungere un watermark in un file DGN.
Esempio di Codice
Il codice qui sotto mostra come raggiungere lo stesso obiettivo utilizzando Aspose.CAD per JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async onFileSelected(event) { | |
const file: File = event.target.files[0]; //file.dgn | |
file.arrayBuffer().then(async buff => { | |
let x = new Uint8Array(buff); | |
this.imgFile = await Image.load(x); | |
let option = new PngOptions(); | |
option.userWatermarkColor = new Color(); | |
option.userWatermarkText = 'Aspose.CAD'; | |
var exportedFile = await Image.save(this.imgFile, option); | |
var blob = new Blob([exportedFile], { type: 'application/octet-stream' }); | |
}); | |
} |