We know that, we can get rgb of bitmap image with using the code as follow :
BufferedImage img = ImageIO.read(new File(bitmapURL));
int[] pixels = img.getRGB(0, 0, img.getWidth(), img.getHeight(), null, 0, img.getWidth());
And, after executing this parts of code, we have an array of integers that contains 4 bytes for Alpha, Red, Green and Blue
colors of any pixel. So, i want to know that how can we convert an array of integers like int [] myPixels;
to Bitmap ? Could any one please help me to reach this?
Thanks in advance :)
BufferedImage im = new BufferedImage(width, height);
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
im.setRGB(...);
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.