Class FileFormat

  • java.lang.Object
        • com.aspose.imaging.FileFormat

  • public final class FileFormat

    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,,,
    • Field Summary

      Modifier and Type Field and Description
      static long Apng
      The animated Png file format.
      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 Dxf
      The AutoCAD Drawing Exchange Format.
      static long Emf
      The Emf/Emf+ file format
      static long Emz
      The emz, compressed emf
      static long Eps
      The Encapsulated PostScript format
      static long FOdg
      The fodg, flat odg format
      static long Gif
      Gif file format.
      static long Html5Canvas
      The Html5 Canvas 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 Svgz
      The SVGZ, compressed svg
      static long Tga
      The Truevision TGA 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
      static long Wmz
      The WMZ, compressed wmf
      • Fields inherited from class

    • Method Summary

      • Methods inherited from class

        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