3D kresby
Contents
[
Hide
]Export 3DS Formátu do PNG
Aspose.CAD pro JavaScript v Angular umožňuje vývojářům exportovat soubor 3DS do formátu PNG. Přístup k převodu 3DS na PNG funguje následovně:
- Načtěte soubor s kresbou 3DS pomocí metody Image.load.
- Zavolejte Image.save a předejte objekt PngOptions jako druhý parametr.
Ukázkový kód
Následující kód ukazuje, jak dosáhnout stejného cíle pomocí Aspose.CAD pro JavaScript
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.3ds | |
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' }); | |
}); | |
} |