แบบแปลน IFC
Contents
[
Hide
]การส่งออกฟอร์แมต IFC ไปยัง PNG
Aspose.CAD สำหรับ .NET ช่วยให้นักพัฒนาสามารถส่งออกไฟล์ IFC เป็น PNG. ต่อไปนี้คือโค้ดที่แสดงวิธีการเข้าถึงไฟล์ IFC และแปลงเป็น PNG โดยใช้ CadRasterizationOptions และ PngOptions.
โค้ดตัวอย่าง
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); | |
} | |
} |