Source Code : Getting and Setting Pixels in a Buffered Image
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Getting and Setting Pixels in a Buffered Image
import java.awt.image.BufferedImage;
public class Main {
public static void main(String[] argv) throws Exception {
BufferedImage bufferedImage = new BufferedImage(200, 200,
BufferedImage.TYPE_INT_RGB);
int rgb = bufferedImage.getRGB(1, 1);
int w = bufferedImage.getWidth(null);
int h = bufferedImage.getHeight(null);
int[] rgbs = new int[w * h];
bufferedImage.getRGB(0, 0, w, h, rgbs, 0, w);
rgb = 0xFF00FF00; // green
bufferedImage.setRGB(1, 1, rgb);
}
}
Thank with us