Class ArtFormats

java.lang.Object
com.codename1.art.ArtFormats

public final class ArtFormats extends Object
Opens a graphics document in whichever format it is: PSD or PSB, SVG, Sketch, .cn1gfx, or Figma REST API JSON. The format is found from the bytes, not the name.
  • Field Details

  • Method Details

    • read

      public static ArtDocument read(InputStream in) throws IOException

      Reads a document.

      Parameters
      • in: the file; read to its end, not closed
      Throws:
      IOException
    • read

      public static ArtDocument read(byte[] data) throws IOException

      Reads a document from bytes.

      Parameters
      • data: the file
      Throws:
      IOException
    • detect

      public static String detect(byte[] data)

      The format of a file: "psd", "svg", "sketch", "cn1gfx", "figma" or null.

      Parameters
      • data: the start of the file; a few kilobytes are enough