HTML
JPG
CAD
XML
DWT
PNG
تحويل DWT إلى PNG عبر C #
قم بتحويل DWT إلى PNG على الفور دون الحاجة إلى AutoCAD® أو أي برنامج عرض آخر.
لتحويل DWT إلى PNG ، سنستخدم Aspose.CAD for .NET API وهو غني بالميزات وقوي و سهل الاستخدام للتعامل مع المستندات وتحويلها API لمنصة C #. افتح مدير الحزم NuGet ، وابحث عن Aspose.CAD وقم بتثبيته. يمكنك أيضًا استخدام الأمر التالي من Package Manager Console.
أمر وحدة تحكم مدير الحزم
PM> Install-Package Aspose.CAD
خطوات تحويل DWT إلى PNG عبر C #
- قم بتحميل ملف DWT باستخدام طريقة Image.Load
- تعيين كائن CadRasterizationOptions مع ارتفاع الصفحة وعرضها
- قم بإنشاء مثيل لفئة PngOptions وقم بتعيين خاصية VectorRasterizationOptions الخاصة بها
- استدعاء طريقة Image.Save أثناء تمرير مسار الملف الناتج وكائن PngOptions
متطلبات التحويل
- Microsoft Windows أو نظام تشغيل متوافق مع .NET Framework و .NET Core و PHP و VBScript و Delphi و C ++ عبر COM Interop.
- بيئة التطوير مثل Microsoft Visual Studio.
- Aspose.CAD لـ .NET DLL المشار إليها في مشروعك.
يوضح نموذج الشفرة هذا تحويل DWT إلى PNG C #
This file contains 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
// 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.