ImageIO: getImageWritersByFormatName(String formatName) : ImageIO « javax.imageio « Java by API






ImageIO: getImageWritersByFormatName(String formatName)

  
import java.util.Iterator;

import javax.imageio.ImageIO;

public class Main {
  public static void main(String[] argv) throws Exception {
    boolean b;

    // Check availability using a format name
    b = canWriteFormat("foo"); // false
    b = canWriteFormat("gif"); // true
    b = canWriteFormat("giF"); // true
  }
 
  public static boolean canWriteFormat(String formatName) {
    Iterator iter = ImageIO.getImageWritersByFormatName(formatName);
    return iter.hasNext();
  }

}

   
    
  








Related examples in the same category

1.ImageIO: createImageInputStream(Object input)
2.ImageIO: getImageReaders(Object input)
3.ImageIO: getImageReadersByFormatName(String formatName)
4.ImageIO: getImageReadersByMIMEType(String MIMEType)
5.ImageIO: getImageReadersBySuffix(String fileSuffix)
6.ImageIO: getImageWritersByMIMEType(String MIMEType)
7.ImageIO: getImageWritersBySuffix(String fileSuffix)
8.ImageIO: getReaderFormatNames()
9.ImageIO: getReaderMIMETypes()
10.ImageIO: getWriterFormatNames()
11.ImageIO: getWriterMIMETypes()
12.ImageIO: read(File input)
13.ImageIO: read(URL input)
14.ImageIO: write(RenderedImage im, String formatName, File output)