Java Argb取消定位/重新定位问题 public static int[]getIntARGB(int argb){ int result[]=新int[4]; 结果[0]=(argb&0xff000000)>>24; 结果[1]=(argb&0x00FF00
Argb取消定位/重新定位问题Java Argb取消定位/重新定位问题 public static int[]getIntARGB(int argb){ int result[]=新int[4]; 结果[0]=(argb&0xff000000)>>24; 结果[1]=(argb&0x00FF00,java,image,argb,Java,Image,Argb,Argb取消定位/重新定位问题 public static int[]getIntARGB(int argb){ int result[]=新int[4]; 结果[0]=(argb&0xff000000)>>24; 结果[1]=(argb&0x00FF0000)>>16; 结果[2]=(argb&0x0000FF00)>>8; 结果[3]=(argb&0x000000FF); 返回结果; } 公共静态int getARBGInt(int a、int r、int g、int b){ 返回((apu
public static int[]getIntARGB(int argb){
int result[]=新int[4];
结果[0]=(argb&0xff000000)>>24;
结果[1]=(argb&0x00FF0000)>>16;
结果[2]=(argb&0x0000FF00)>>8;
结果[3]=(argb&0x000000FF);
返回结果;
}
公共静态int getARBGInt(int a、int r、int g、int b){
返回((apublicstaticintgetarbgint(inta,intr,intg,intb){
return(a你不只是简单地分解和休息它。想想|0xFF
在做什么,以及你把那些额外的1
放在哪里,是的,非常感谢,我为什么这么做>很高兴你能解决你的问题;)你总是通过自己发现问题而比别人给你正确的代码学到更多!
public static int[] getIntARGB(int argb){
int result[] = new int[4];
result[0] = (argb & 0xff000000) >> 24;
result[1] = (argb & 0x00FF0000) >> 16;
result[2] = (argb & 0x0000FF00) >> 8;
result[3] = (argb & 0x000000FF);
return result;
}
public static int getARBGInt(int a, int r, int g, int b) {
return ((a << 24) | 0xFF) + ((r << 16) | 0xFF) + ((g << 8) | 0xFF) + (b | 0xFF);
}
public static int getARBGInt(int a, int r, int g, int b) {
return (a << 24) + (r << 16) + (g << 8) + b;
}