Java examples for 2D Graphics:BufferedImage Convert
Save a BufferedImage to a Bitmap file.
//package com.java2s; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; public class Main { /**/* ww w . j a v a2 s . c om*/ * Save a BufferedImage to a Bitmap file. */ public static void saveBmp(BufferedImage bi, String filename) { try { ImageIO.write(bi, "bmp", new File(filename)); } catch (Exception e) { e.printStackTrace(); } } }