You can find all the details at: Convert DGN to JPEG, PNG, or TIFF Image Programmatically in C#
Last active
October 12, 2021 17:04
-
-
Save aspose-com-gists/412be21b594854e6ab040987c3c498b2 to your computer and use it in GitHub Desktop.
Convert DGN to JPEG, PNG, or TIFF Image Programmatically in C#
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
// Load input DGN file using Image class | |
Image image = Image.Load("template.dgn"); | |
// Initialize an object of CadRasterizationOptions | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions() | |
{ | |
PageWidth = 1600, | |
PageHeight = 1600 | |
}; | |
// Create an instance of JpegOptions | |
JpegOptions options = new JpegOptions(); | |
// Set CadRasterizationOptions properties | |
options.VectorRasterizationOptions = rasterizationOptions; | |
// Convert DGN to JPG image | |
image.Save("output.jpg", options); |
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
// Load DGN file using Image class | |
Image image = Image.Load("template.dgn"); | |
// Create an instance of CadRasterizationOptions and set image height & width | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions() | |
{ | |
PageWidth = 1600, | |
PageHeight = 1600 | |
}; | |
// Create an instance of PngOptions | |
PngOptions options = new PngOptions(); | |
// Set the VectorRasterizationOptions property as CadRasterizationOptions | |
options.VectorRasterizationOptions = rasterizationOptions; | |
// Convert DGN to PNG Image | |
image.Save("output.png", options); |
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
// Load input DGN file using Image class | |
Image image = Image.Load("template.dgn"); | |
// Initialize an object of CadRasterizationOptions | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions() | |
{ | |
PageWidth = 1600, | |
PageHeight = 1600 | |
}; | |
// Create an instance of TiffOptions | |
TiffOptions options = new TiffOptions(FileFormats.Tiff.Enums.TiffExpectedFormat.Default); | |
// Set the VectorRasterizationOptions property | |
options.VectorRasterizationOptions = rasterizationOptions; | |
// Convert DGN to TIFF Image | |
image.Save("output.tiff", options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment