1
我们知道,我们可以得到位图图像的RGB使用的代码如下:转换阵列为位图
BufferedImage img = ImageIO.read(new File(bitmapURL));
int[] pixels = img.getRGB(0, 0, img.getWidth(), img.getHeight(), null, 0, img.getWidth());
而且,执行的代码,这部分后,我们有一个整数数组其中包含任何像素的Alpha, Red, Green and Blue
颜色的4个字节。所以,我想知道如何将像int [] myPixels;
这样的整数数组转换为位图?任何人都可以帮助我达成这个目标吗?
感谢提前:)
请注意,我们有一个一维数组,而不是二维数组!那么,我该如何将其转换为位图? –
是的,你需要为你设置的像素计算阵列中正确的偏移量 – ControlAltDel
然后你应该用'for(int i = 0; i
StepTNT