Java Color Create generateBlankImage(int w, int h, Color col)

Here you can find the source of generateBlankImage(int w, int h, Color col)

Description

generate Blank Image

License

Open Source License

Declaration

public static Image generateBlankImage(int w, int h, Color col) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

import java.awt.Graphics2D;

import java.awt.Image;

import java.awt.image.BufferedImage;

public class Main {
    public static Image generateBlankImage(int w, int h, Color col) {
        BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = (Graphics2D) img.getGraphics();
        g2.setBackground(col);/*from  ww  w  . ja va2 s .  co  m*/
        g2.clearRect(0, 0, w, h);
        return img;
    }
}

Related

  1. colorFromRGB(int red, int green, int blue)
  2. colorFromRGBA(int red, int green, int blue, int alpha)
  3. colorFromString(String string)
  4. colorWithARGB(int alpha, int red, int green, int blue)
  5. colorWithIntAndAlpha(int color, int alpha)
  6. generateColor(int fc, int bc)
  7. generateColorFromString(String seed)
  8. generateColorModel()
  9. generateColorRamp(int n)