Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 21, 2017 11:10:31 AM(UTC)

Nick  
Nick

Groups: Registered, Tech Support, Administrators
Posts: 56


The RasterCodecs object contains several static classes which can be used to obtain information about an image. The RasterCodecs.GetExtension() static method can be used to obtain the typical file system extension for the specified format. Here's our documentation on the method.
RasterCodecs.GetExtension()

The command accepts as a parameter any of the values in the RasterImageFormat enumeration.
RasterImageFormat

The return value is a string representing the typical file extension, without the leading period. Note this code snippet:

Code:

	string extension = RasterCodecs.GetExtension(RasterImageFormat.CcittGroup4); 


The value of "extension" would be "tif".

Here's a code snippet which displays all available extensions to the console.

Code:

         RasterImageFormat[] values = (RasterImageFormat[])Enum.GetValues(typeof(RasterImageFormat));
         for (int i = 0; i < values.Length; i++)
         {
            Console.WriteLine("RasterImageFormat:\t" + Enum.GetName(typeof(RasterImageFormat), values[i]).PadRight(20) + "\tExtension:\t" + RasterCodecs.GetExtension(values[i]));
         }

Edited by moderator Friday, December 22, 2017 3:53:25 PM(UTC)  | Reason: Not specified

Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
nick@leadtools.com
www.LEADTOOLS.com
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2018, Yet Another Forum.NET
This page was generated in 0.163 seconds.