رسومات CF2
Contents
[
Hide
]تصدير تنسيق CF2 إلى PNG
تتيح Aspose.CAD لجافا سكريبت في أنغولار للمطورين تصدير ملف CF2 إلى تنسيق PNG. تعمل طريقة تحويل CF2 إلى PNG على النحو التالي:
- تحميل ملف رسم CF2 باستخدام طريقة Image.load.
- استدعاء Image.save مع تمرير كائن من PngOptions كمعامل ثانٍ.
نموذج الكود
يوضح الكود أدناه كيفية تحقيق الهدف نفسه باستخدام Aspose.CAD لجافا سكريبت
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.cf2 | |
file.arrayBuffer().then(async buff => { | |
let x = new Uint8Array(buff); | |
this.imgFile = await Image.load(x); | |
var exportedFile = await Image.save(this.imgFile, new PngOptions()); | |
var blob = new Blob([exportedFile], { type: 'application/octet-stream' }); | |
}); | |
} | |