HTML JPG CAD XML DWT
  Product Family
PNG

แปลง DWT เป็น PNG ผ่าน C #

แปลง DWT เป็น PNG ได้ทันทีโดยไม่ต้องใช้ AutoCAD® หรือซอฟต์แวร์แสดงผลอื่นๆ

ในการแปลง DWT เป็น PNG เราจะใช้ API ของ Aspose.CAD for .NET ซึ่งเป็น API ที่มีคุณลักษณะหลากหลาย มีประสิทธิภาพ และ ง่ายต่อการใช้การจัดการเอกสารและการแปลง API สำหรับแพลตฟอร์ม C# เปิด NuGet package manager ค้นหา Aspose.CAD และติดตั้ง คุณยังสามารถใช้คำสั่งต่อไปนี้จาก Package Manager Console

คำสั่งคอนโซลตัวจัดการแพ็คเกจ


PM> Install-Package Aspose.CAD

ขั้นตอนในการแปลง DWT เป็น PNG ผ่าน C#

  1. โหลดไฟล์ DWT ด้วย Image.Load method
  2. ตั้งค่าวัตถุของ CadRasterizationOptions ด้วยความสูง & ความกว้างของหน้า
  3. สร้างอินสแตนซ์ของคลาส PngOptions และตั้งค่าคุณสมบัติ VectorRasterizationOptions
  4. เรียกเมธอด Image.Save ขณะส่งพาธไฟล์ผลลัพธ์ & ออบเจกต์ของ PngOptions

ข้อกำหนดการแปลง

  • Microsoft Windows หรือระบบปฏิบัติการที่เข้ากันได้กับ .NET Framework, .NET Core และ PHP, VBScript, Delphi, C++ ผ่าน COM Interop
  • สภาพแวดล้อมการพัฒนาเช่น Microsoft Visual Studio
  • Aspose.CAD for .NET DLL ที่อ้างอิงในโครงการของคุณ
 

โค้ดตัวอย่างนี้แสดง DWT ถึง PNG C# Conversion

// load DWT in an instance of Image via its Load method
using (var image = Image.Load("template.dwt"))
{
// create an instance of CadRasterizationOptions and set page height & width
var rasterizationOptions = new ImageOptions.CadRasterizationOptions()
{
PageWidth = 1600,
PageHeight = 1600
};
// create an instance of PngOptions
var options = new ImageOptions.PngOptions();
// set the VectorRasterizationOptions property as CadRasterizationOptions
options.VectorRasterizationOptions = rasterizationOptions;
// export DWT to PNG
image.Save("output.png", options);
}
 

แอพฟรีเพื่อแปลง DWT เป็น PNG

Check our live demos for DWT to PNG conversion with following benefits.

  No need to download or setup anything.
  No need to write any code.
  Just upload your DWT file and hit the "Convert" button.
  You will instantly get the download link for resultant PNG file.