Desenho DGN
Contents
[
Hide
]Exportando o Formato DGN para PNG
Aspose.CAD para Javascript em Angular permite que os desenvolvedores exportem um arquivo DGN para o formato PNG. A abordagem de conversão de DGN para PNG funciona da seguinte maneira:
- Carregue o arquivo de desenho DGN usando o método Image.load.
- Chame Image.save passando um objeto de PngOptions como o segundo parâmetro.
Código de Exemplo
O código abaixo mostra como alcançar o mesmo objetivo usando Aspose.CAD para 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.dgn | |
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' }); | |
}); | |
} |