Rysunki DXB
Contents
[
Hide
]Eksportowanie formatu DXB do PNG
Aspose.CAD dla Javascripta w Angularze pozwala deweloperom na eksportowanie pliku DXB do formatu PNG. Podejście do konwersji DXB na PNG działa w następujący sposób:
- Załaduj plik rysunku DXB przy użyciu metody Image.load.
- Wywołaj Image.save, przekazując obiekt PngOptions jako drugi parametr.
Przykładowy kod
Poniższy kod pokazuje, jak osiągnąć ten sam cel przy użyciu Aspose.CAD dla Javascripta
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.dxb | |
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' }); | |
}); | |
} |