3DS 도면
Contents
[
Hide
]3DS 형식을 PNG로 내보내기
Aspose.CAD for Javascript in Angular는 개발자가 3DS 파일을 PNG 형식으로 내보낼 수 있도록 허용합니다. 3DS에서 PNG로 변환하는 방법은 다음과 같습니다:
- Image.load 메서드를 사용하여 3DS 도면 파일을 로드합니다.
- 두 번째 매개변수로 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.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' }); | |
}); | |
} |