Java examples for 2D Graphics:BufferedImage Create
create Image as BufferedImage
//package com.java2s; import java.awt.image.BufferedImage; public class Main { public static void main(String[] argv) throws Exception { int width = 2; int height = 2; System.out.println(createImage(width, height)); }//w w w . jav a 2 s . co m public static BufferedImage createImage(int width, int height) { return new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); } }