العمل مع علامة مائية

إضافة علامة مائية في DGN

أحيانًا ترغب في إضافة بعض العلامات المائية إلى الرسومات للإشارة إلى الغرض من الرسومات أو من أنشأها. يتيح لك Aspose.CAD لـ Python إضافة علامة مائية في ملف DGN.

كود العينة

يوضح الكود أدناه كيفية تحقيق نفس الهدف باستخدام Aspose.CAD لجافا سكريبت

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