Class IcoUtilities

java.lang.Object
com.iizix.image.IcoUtilities

public class IcoUtilities extends Object
Utility to create an ICO file from transparent PNG files (or opaque JPG files).
Author:
Christopher Mindus
  • Constructor Details

    • IcoUtilities

      public IcoUtilities()
  • Method Details

    • createIco

      public static void createIco(File ico, File... files) throws IOException
      Creates an ICO file, i.e. a merge of buffered images from transparent PNG files (or opaque JPEG/JPG or BMP files).
      Parameters:
      ico - The destination icon file.
      files - Bitmap files (1 to 32) in JPEG/JPG, PNG or BMP format. The format is read from the file's content, not from its extension, so any other format ImageIO can read (e.g. GIF) is accepted too.
      Throws:
      IOException - For file errors, e.g. a missing or unreadable file, or content that is not an image ImageIO can read.
      NullPointerException - If ico or files is null.
      IllegalArgumentException - If files count is not 1 to 32, or if images in files are not square, or the image size is not between 16 and 256, or if two image files have the same size.
    • main

      public static void main(String[] args)
      Main class.
      Parameters:
      args - The argument list of files: destination ico, followed by list of JPG/JPEG/PNG/BMP files.