create Image as BufferedImage - Java 2D Graphics

Java examples for 2D Graphics:BufferedImage Create

Description

create Image as BufferedImage

Demo Code


//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);
    }
}

Related Tutorials