HTML
JPG
CAD
XML
DXF
PNG
تحويل DXF إلى PNG عبر C #
قم بتحويل DXF إلى PNG على الفور دون الحاجة إلى AutoCAD® أو أي برنامج عرض آخر.
لتحويل DXF إلى PNG ، سنستخدم Aspose.CAD for .NET API وهو غني بالميزات وقوي و سهل الاستخدام للتعامل مع المستندات وتحويلها API لمنصة C #. افتح مدير الحزم NuGet ، وابحث عن Aspose.CAD وقم بتثبيته. يمكنك أيضًا استخدام الأمر التالي من Package Manager Console.
أمر وحدة تحكم مدير الحزم
PM> Install-Package Aspose.CAD
خطوات تحويل DXF إلى PNG عبر C #
- قم بتحميل ملف DXF باستخدام طريقة 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 المشار إليها في مشروعك.
يوضح نموذج الشفرة هذا تحويل DXF إلى 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 DXF in an instance of Image via its Load method | |
using (var image = Image.Load("template.dxf")) | |
{ | |
// 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 DXF to PNG | |
image.Save("output.png", options); | |
} |
تطبيق مجاني لتحويل DXF إلى PNG
Check our live demos for DXF to PNG conversion with following benefits.
No need to download or setup anything.
No need to write any code.
Just upload your DXF file and hit the "Convert" button.
You will instantly get the download link for resultant PNG file.