العمل مع تنسيق ملف OBJ
Contents
[
Hide
]يدعم Aspose.CAD الآن تنسيق ملف OBJ. تنسيق ملف OBJ هو هندسة ثلاثية الأبعاد تحتوي على خرائط قوام، و إحداثيات ثلاثية الأبعاد، وأوجه متعددة الأضلاع، ومعلومات أخرى عن الكائنات.
تصدير تنسيق OBJ إلى PNG
يسمح Aspose.CAD لجافا سكريبت في Angular للمطورين بتصدير ملف OBJ إلى تنسيق PNG. تعمل طريقة تحويل OBJ إلى PNG كما يلي:
- تحميل ملف الرسم OBJ باستخدام طريقة 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.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' }); | |
}); | |
} |