IFC-tekeningen

Exporteren van IFC-indeling naar PNG

Aspose.CAD voor .NET stelt ontwikkelaars in staat om een IFC bestand te exporteren naar PNG. Hieronder staat de code die demonstratie hoe de IFC-bestand te openen en dit te converteren naar PNG met behulp van CadRasterizationOptions en PngOptions.

Voorbeeldcode

//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);
}
}