IFC Drawings
Contents
[
Hide
]صادر کردن فرمت IFC به PNG
Aspose.CAD برای .NET به توسعهدهندگان این امکان را میدهد که یک فایل IFC را به PNG صادر کنند. در زیر کد نشان داده شده است که چگونه میتوان به فایل IFC دسترسی پیدا کرد و آن را با استفاده از CadRasterizationOptions و PngOptions به PNG تبدیل کرد.
کد نمونه
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
//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); | |
} | |
} |