IFC 도면
Contents
[
Hide
]IFC 형식을 PNG로 내보내기
Aspose.CAD for .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); | |
} | |
} |