How can we get the supported image types in Java
是的,我們可以使用 Java 中的 ImageIO 類獲取受支援的影像型別。下面是 Java 中獲取受支援影像型別的示例
示例
package my;
import javax.imageio.ImageIO;
public class SwingDemo {
public static void main(String[] args) throws Exception {
String[] imgTypes = ImageIO.getReaderFileSuffixes();
System.out.print("Supported Image Types = ");
for (String type : imgTypes) {
System.out.print("
" + type);
}
}
}輸出
Supported Image Types = jpg tif tiff bmp gif png wbmp jpeg
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 語言
C++
C#
MongoDB
MySQL
Javascript
PHP