我想知道如何单个像素的alpha通道可以是-1?我正在浏览PNG图像的每个像素(加载到缓冲图像中,ARGB类型)。许多alpha值是-1(其他都大于零) - 这怎么可能?不应该在0到255之间?代码如下。感谢您的任何提示!alpha通道如何为-1?
// imagine some great loop for x and y before this code
int a = (scaledImage.getRGB(x, y) & 0xff000000) >> 24; // kill all bits except for the first 8, shift 24 to the right to get them
System.out.println("" + a);
谢谢您也提供解决方案的问题! –