How to Convert DGN to JPG in C#

This basic tutorial explains how to convert DGN to JPG in C#. It covers all the important information like the step-wise algorithm and the code snippet to export DGN to JPG image in C#. You will explore different properties to control DGN to JPG image rendering process.

Steps to Convert DGN to JPG in C#

  1. Install Aspose.CAD for .NET from the NuGet Package Manager
  2. Load the input DGN file with the Image class
  3. Create an object of CadRasterizationOptions class and set its properties
  4. Initialize a JpegOptions class object to set the output JPG options
  5. Convert the DGN to JPG with the Save method

The steps we have discussed above precisely explain the algorithm to convert DGN to JPEG in C#. First, the details to configure the environment are shared and then you can load the input file. Subsequently, the properties like image size, scaling, etc. are set before rendering the image as a JPG file.

Code to Convert DGN to JPG in C#

This code snippet can be used to render DGN to JPG in C# with a couple of API calls. The CadRasterizationOptions class is used to set automatic layout scaling, layers, margins, quality, etc. Finally, the JpegOptions class object is initialized for rendering the output JPG image.

In this tutorial, you have learned to export a DGN file to JPG in C#. However, if you want to take a look at PDF rendering then please refer to the article on how to Convert DGN to PDF in C#.

 English