Dessins IGES
Contents
[
Hide
]Exportation du format IGES vers PNG
Aspose.CAD pour Javascript dans Angular permet aux développeurs d’exporter un fichier IGES au format PNG. L’approche de conversion IGES vers PNG fonctionne comme suit :
- Chargez le fichier de dessin IGES en utilisant la méthode Image.load.
- Appelez Image.save en passant un objet de PngOptions en tant que deuxième paramètre.
Code d’exemple
Le code ci-dessous montre comment atteindre le même objectif en utilisant Aspose.CAD pour 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.igs | |
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' }); | |
}); | |
} |