COLLADA 描画
Contents
[
Hide
]COLLADA フォーマットを PNG にエクスポートする
Aspose.CAD for Javascript in Angular は、開発者が COLLADA ファイルを PNG フォーマットにエクスポートすることを可能にします。 COLLADA から PNG への変換アプローチは以下のように機能します:
- Image.load メソッドを使用して COLLADA 描画ファイルを読み込みます。
- PngOptions のオブジェクトを第二引数として渡す際に Image.save を呼び出します。
サンプルコード
以下のコードは、Aspose.CAD for 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' }); | |
}); | |
} |