I am having trouble understanding what the values of a pixel mean in an array and how to change them. Could someone please explain?
Edit: Also what is the opperation to set a certain pixel color’s alpha to 0? I found this example
for(int ctr = 0; ctr < pixels.length; ctr++)
{
int alpha = (pixels[ctr] >> 24) & 0xff;
if (alpha != 0)
{
// set this pixels transparancy to 25%
pixels[ctr] = 0x4F000000 | (pixels[ctr] & 0x00FFFFFF);
}
}
Can someone explain the
int alpha = (pixels[ctr] >> 24) & 0xff line of code?
Also if I wish to search the array for all the red pixels what value do I look for?