نقشههای 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' }); | |
}); | |
} |