Java图片类型转换

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;

public class ChangeImageType {

 public ChangeImageType() {}

 public static void main(String[] args) {
  try {
   File outputFile = null;
   File inputFile = new File("C:\\test.bmp");
   BufferedImage input = ImageIO.read(inputFile);
   // 转换为png格式的图片
   outputFile = new File("C:\\test.PNG");
   ImageIO.write(input, "PNG", outputFile);
  }
  catch (IOException e) {
   e.printStackTrace();
  }
 }
}

你可能感兴趣的:(java,C++,c,C#)