Java BufferedImage Operation setBackgroud(BufferedImage image, Color backgroundColor)

Here you can find the source of setBackgroud(BufferedImage image, Color backgroundColor)

Description

set Backgroud

License

Open Source License

Declaration

public static BufferedImage setBackgroud(BufferedImage image, Color backgroundColor) 

Method Source Code


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

import java.awt.Color;

import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage setBackgroud(BufferedImage image, Color backgroundColor) {
        Graphics2D g2d = image.createGraphics();
        g2d.setPaint(backgroundColor);/*ww w.ja va2s. co  m*/
        g2d.fillRect(0, 0, image.getWidth(), image.getHeight());
        g2d.dispose();
        return image;
    }
}

Related

  1. sample9Points(BufferedImage src, int x, int y)
  2. scanFill(BufferedImage sourceImage)
  3. scrapeColors(BufferedImage image)
  4. setArrayAlpha(BufferedImage image, int[] array)
  5. setArrayColor(BufferedImage image, int[][] array)
  6. setBGRPixels(byte[] bgrPixels, BufferedImage img, int x, int y, int w, int h)
  7. setBrightnessFactor(BufferedImage img, float multiple, BufferedImage dest)
  8. setColor(BufferedImage image, int x, int y, int[] color, String colorModel)
  9. setCompressionType(ImageWriteParam param, BufferedImage image)