การทำงานกับลายน้ำ

เพิ่มลายน้ำใน DGN

บางครั้งคุณอาจต้องการเพิ่มลายน้ำให้กับแบบวาดเพื่อระบุวัตถุประสงค์ของแบบวาดหรือต้นกำเนิดของมัน Aspose.CAD สำหรับ Python ช่วยให้คุณสามารถเพิ่มลายน้ำในไฟล์ DGN ได้

ตัวอย่างโค้ด

โค้ดด้านล่างแสดงวิธีการบรรลุเป้าหมายเดียวกันโดยใช้ Aspose.CAD สำหรับ JavaScript

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' });
});
}