العمل مع علامة مائية
Contents
[
Hide
]إضافة علامة مائية في DGN
أحيانًا ترغب في إضافة بعض العلامات المائية إلى الرسومات للإشارة إلى الغرض من الرسومات أو من أنشأها. يتيح لك Aspose.CAD لـ Python إضافة علامة مائية في ملف DGN.
كود العينة
يوضح الكود أدناه كيفية تحقيق نفس الهدف باستخدام Aspose.CAD لجافا سكريبت
This file contains hidden or 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' }); | |
}); | |
} |