J
jimgardener
hi
when i use BufferedImage.getRGB(...) method i can get the pixels as
integers.I need to get the r,g,b components from each of these values.
If value of a pixel(from the int[] filled by the getRGB()) is
-11382190 ,i need to get the r,g,b
i know that if r,g,b values are 82,82,82 for a pixel then they can be
packed as
int alpha=255;
int res=(alpha<<24)|(r<<16 )|( g<<8) | b ;
and res will be -11382190.
but i am not sure how to do the reverse(ie extract the components from
the above value)
can someone help?
when i use BufferedImage.getRGB(...) method i can get the pixels as
integers.I need to get the r,g,b components from each of these values.
If value of a pixel(from the int[] filled by the getRGB()) is
-11382190 ,i need to get the r,g,b
i know that if r,g,b values are 82,82,82 for a pixel then they can be
packed as
int alpha=255;
int res=(alpha<<24)|(r<<16 )|( g<<8) | b ;
and res will be -11382190.
but i am not sure how to do the reverse(ie extract the components from
the above value)
can someone help?