رسومات STL

تصدير صيغة STL إلى PNG

تسمح Aspose.CAD لـ .NET للمطورين بتصدير ملف STL إلى PNG. فيما يلي الشيفرة التي توضح كيفية الوصول إلى ملف STL وتحويله إلى PNG باستخدام CadRasterizationOption و PngOptions.

عينة من الشيفرة

string MyDir = RunExamples.GetDataDir_ConvertingCAD();
string sourceFilePath = MyDir + "galeon.stl";
using (var cadImage = (CadImage)Image.Load(sourceFilePath))
{
var rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = 100;
rasterizationOptions.PageHeight = 100;
PngOptions pngOptions = new PngOptions();
pngOptions.VectorRasterizationOptions = rasterizationOptions;
string outPath = sourceFilePath + ".png";
cadImage.Save(outPath, pngOptions);
}
}