کار با واترمارک
Contents
[
Hide
]اضافه کردن واترمارک در یک DGN
گاهی اوقات میخواهید به نقشهها واترمارکهایی اضافه کنید تا هدف از نقشهها یا کسی که آنها را ایجاد کرده است را مشخص کنید. Aspose.CAD برای Python به شما اجازه میدهد تا یک واترمارک در یک فایل DGN اضافه کنید.
کد نمونه
کد زیر نشان میدهد که چگونه میتوان به این هدف با استفاده از Aspose.CAD برای 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' }); | |
}); | |
} |