Convert IFC to JPG or PNG Image using C#

IFC to JPG PNG Image

IFC files are used for modeling buildings, facilities, and different infrastructure. However, limited applications support this file format so you may need to convert an IFC file to a JPG or PNG image for previewing the contents in different system environments. This article covers how to convert an IFC file into an image programmatically with C#.

IFC to JPG or PNG Image Converter – C# API Installation

Aspose.CAD for .NET API supports working with IFC and many other file formats. You can install the API by downloading the DLL file from the Downloads section or with the NuGet installation command below:

PM> Install-Package Aspose.CAD

Convert IFC File to JPG Image Programmatically using C#

You can convert an IFC file to a JPG image with the steps below:

  1. Load input IFC file using the Image class.
  2. Create an instance of CadRasterizationOptions class.
  3. Create an object of JPGOptions class.
  4. Set the VectorRasterizationOptions and convert the IFC file to a JPG image

The following code snippet demonstrates how to convert an IFC file to a JPG image programmatically with C#:

Convert IFC to PNG Image with C#

You can convert an IFC file to a PNG image with the following steps:

  1. Load input IFC file using the Image class.
  2. Create an instance of CadRasterizationOptions class.
  3. Create an object of PngOptions type.
  4. Specify the VectorRasterizationOptions and convert IFC to PNG image.

The following code snippet shows how to convert an IFC file to a PNG image programmatically using C#:

Get Free Temporary License

You can evaluate the API without any evaluation limitation by requesting a free temporary license.

Conclusion

In this article, you have learned how to convert an IFC file to an image like JPG or PNG programmatically using C#. Please go through the documentation to explore several other features offered by the API. In case of any queries, please write to us at the free support forum.

See Also

Convert IGS IGES File to PDF Programmatically using C#