Packages

 

com.aspose.imaging

Interfaces

Classes

Exceptions

com.aspose.imaging

Class FileFormat

  • java.lang.Object
    • com.aspose.ms.System.ValueType<com.aspose.ms.System.Enum>
      • com.aspose.ms.System.Enum
        • com.aspose.imaging.FileFormat


  • public final class FileFormat
    extends com.aspose.ms.System.Enum

    One of supported imaging file formats.

    Code example:

    This example shows how to determine the image format without loading the entire image from a file.


    String dir = "c:\\temp\\";
    
    // Use an absolute path to the file
    long format = com.aspose.imaging.Image.getFileFormat(dir + "sample.gif");
    
    // A string represenation of the file format.
    String strFormat;
    if (format == com.aspose.imaging.FileFormat.Bmp) {
        strFormat = "BMP";
    } else if (format == com.aspose.imaging.FileFormat.Gif) {
        strFormat = "GIF";
    } else if (format == com.aspose.imaging.FileFormat.Dicom) {
        strFormat = "DICOM";
    } else if (format == com.aspose.imaging.FileFormat.Djvu) {
        strFormat = "DJVU";
    } else if (format == com.aspose.imaging.FileFormat.Dng) {
        strFormat = "DNG";
    } else if (format == com.aspose.imaging.FileFormat.Png) {
        strFormat = "PNG";
    } else if (format == com.aspose.imaging.FileFormat.Jpeg) {
        strFormat = "JPEG";
    } else if (format == com.aspose.imaging.FileFormat.Jpeg2000) {
        strFormat = "JPEG2000";
    } else if (format == com.aspose.imaging.FileFormat.Psd) {
        strFormat = "PSD";
    } else if (format == com.aspose.imaging.FileFormat.Tiff) {
        strFormat = "Tiff";
    } else if (format == com.aspose.imaging.FileFormat.Webp) {
        strFormat = "WEBP";
    } else if (format == com.aspose.imaging.FileFormat.Cdr) {
        strFormat = "CDR";
    } else if (format == com.aspose.imaging.FileFormat.Cmx) {
        strFormat = "CMX";
    } else if (format == com.aspose.imaging.FileFormat.Emf) {
        strFormat = "EMF";
    } else if (format == com.aspose.imaging.FileFormat.Wmf) {
        strFormat = "WMF";
    } else if (format == com.aspose.imaging.FileFormat.Svg) {
        strFormat = "SVG";
    } else if (format == com.aspose.imaging.FileFormat.Odg) {
        strFormat = "ODG";
    } else if (format == com.aspose.imaging.FileFormat.Eps) {
        strFormat = "EPS";
    } else {
        strFormat = "UNDEFINED";
    }
    
    System.out.println("The file format is " + strFormat);
    

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.aspose.ms.System.Enum

        com.aspose.ms.System.Enum.AbstractEnum, com.aspose.ms.System.Enum.FlaggedEnum, com.aspose.ms.System.Enum.ObjectEnum, com.aspose.ms.System.Enum.SimpleEnum
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static long Bmp
      Bmp (Dib) file format.
      static long Cdr
      The CDR file format
      static long Cmx
      The CMX file format
      static long Custom
      Custom file format.
      static long Dicom
      The dicom format
      static long Djvu
      Djvu file format
      static long Dng
      The DNG file format
      static long Emf
      The Emf/Emf+ file format
      static long Eps
      The Encapsulated PostScript format
      static long Gif
      Gif file format.
      static long Jpeg
      Jpeg file format.
      static long Jpeg2000
      Jpeg2000 file format
      static long Odg
      The Open document graphic format
      static long Otg
      The otg file format
      static long Png
      Png file format.
      static long Psd
      Psd file format.
      static long Svg
      SVG file format
      static long Tiff
      Tiff file format.
      static long Undefined
      Undefined file format.
      static long Webp
      The webp file format
      static long Wmf
      The Wmf file format
      • Fields inherited from class com.aspose.ms.System.Enum

        EnumSeparatorCharArray
    • Method Summary

      • Methods inherited from class com.aspose.ms.System.Enum

        Clone, CloneTo, format, format, get_Caption, get_Value, getName, getName, getNames, getNames, getNames, getUnderlyingType, getUnderlyingType, getValue, getValues, getValues, getValues, isDefined, isDefined, isDefined, isDefined, parse, parse, parse, parse, register, toObject, toString