שרטוטי DWT
Contents
[
Hide
]ייצוא פורמט DWT ל-PNG
Aspose.CAD עבור Javascript ב-Angular מאפשרת למפתחים לייצא קובץ DWT לפורמט PNG. גישת ההמרה מDWT לPNG פועלת כך:
- טען קובץ שרטוט DWT באמצעות המתוד Image.load.
- קרא ל Image.save תוך כדי העברת אובייקט של PngOptions כפרמטר השני.
קוד דוגמה
הקוד למטה מראה כיצד להשיג את אותה מטרה באמצעות Aspose.CAD עבור 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.dwt | |
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' }); | |
}); | |
} |