Here you can find the source of clearImage(BufferedImage bi)
Parameter | Description |
---|---|
bi | The image to clear. |
public static void clearImage(BufferedImage bi)
//package com.java2s; /* //w w w . ja v a2 s . c om * This file is part of BMix. * * BMix is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * BMix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with BMix. If not, see <http://www.gnu.org/licenses/>. * */ import java.awt.image.BufferedImage; public class Main { /** * Sets all pixels of the given image to black and fully transparent * (RGBA 0). * * @param bi The image to clear. */ public static void clearImage(BufferedImage bi) { for (int x = 0; x < bi.getWidth(); x++) { for (int y = 0; y < bi.getHeight(); y++) { bi.setRGB(x, y, 0); } } } }