Recently, I am working on Image Processing on Android and directly operating on pixels on Android. Unexpectedly, some unexpected things have occurred. The getpixel method of Bitmap class obtains all negative pixel values. It should have been black, that is, 0, and all values have changed to-16777216, which is very strange. However, it is quite special to study this 16777216 carefully because 16777216 = 256*256*256, which is the product of the maximum values of the three RGB color components. In fact, we are very familiar with the inaccurate expression of this value. We often say that 16 million colors are supported when we advertise the screen on mobile phones. Nokia prefers this promotion. -In hexadecimal notation of 16777216, the complement code is # ff000000, which is exactly the opaque black with the Alpha Channel added. Check android
In Android, the color is composed of four components. I assume that YY is the RGB component and the component is ignored. The default a value is 255. Therefore, the highest bit of a pixel in a graph without Channel A is always 1, and there is no unsigned integer in Java. A 32-bit int type variable is returned, which leads to various negative numbers I have encountered.