Java examples for 2D Graphics:BufferedImage Color
is BufferedImage Empty
//package com.java2s; import java.awt.image.BufferedImage; public class Main { public static boolean isEmpty(BufferedImage img) { int w = img.getWidth(); int h = img.getHeight(); int[] rgbs = new int[w * h]; img.getRGB(0, 0, w, h, rgbs, 0, w); for (int i = 0; i < w * h; i++) { if (rgbs[i] != -4861744) { return false; }/*from ww w . j a v a2 s . c om*/ } return true; } }