IFC Drawings

صادر کردن فرمت IFC به PNG

Aspose.CAD برای .NET به توسعه‌دهندگان این امکان را می‌دهد که یک فایل IFC را به PNG صادر کنند. در زیر کد نشان داده شده است که چگونه می‌توان به فایل IFC دسترسی پیدا کرد و آن را با استفاده از CadRasterizationOptions و PngOptions به PNG تبدیل کرد.

کد نمونه

//Setfile name path as other examples
string MyDir = RunExamples.GetDataDir_ConvertingCAD();
string sourceFilePath = MyDir + "example.ifc";
using (IfcImage cadImage = (IfcImage)Image.Load(sourceFilePath))
{
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
rasterizationOptions.PageWidth = 100;
rasterizationOptions.PageHeight = 100;
PngOptions pngOptions = new PngOptions();
pngOptions.VectorRasterizationOptions = rasterizationOptions;
//Set output path as well
string outPath = sourceFilePath + ".png";
cadImage.Save(outPath, pngOptions);
}
}