COLLADA Drawings
Contents
[
Hide
]صادرات فرمت COLLADA به PNG
Aspose.CAD برای Javascript در Angular به توسعه دهندگان این امکان را میدهد که یک فایل COLLADA را به فرمت PNG صادر کنند. رویکرد تبدیل COLLADA به PNG به شکل زیر کار میکند:
- فایل طراحی COLLADA را با استفاده از متد Image.load بارگیری کنید.
- Image.save را با ارسال یک شی از PngOptions به عنوان پارامتر دوم فراخوانی کنید.
کد نمونه
کد زیر نشان میدهد که چگونه میتوانید به هدف مشابه با استفاده از Aspose.CAD برای JavaScript دست یابید.
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.dae | |
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' }); | |
}); | |
} |