Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Argb取消定位/重新定位问题 public static int[]getIntARGB(int argb){ int result[]=新int[4]; 结果[0]=(argb&0xff000000)>>24; 结果[1]=(argb&0x00FF00_Java_Image_Argb - Fatal编程技术网

Java Argb取消定位/重新定位问题 public static int[]getIntARGB(int argb){ int result[]=新int[4]; 结果[0]=(argb&0xff000000)>>24; 结果[1]=(argb&0x00FF00

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

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){
返回((a
publicstaticintgetarbgint(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;
}