//獲取及修改圖像的RGB值和Alpha值
ColorModel cm=ColorModelgetRGBdefault();
for(int i=;i<w*h;i++){
int alpha=cmgetAlpha(pixels[i]);
int red=cmgetRGB(pixels[i]);
int green=cmgetGreen(pixels[i]);
int blue=cmgetBlue(pixels[i]);
//有了上面這些就可以為所欲為了
pixels[i]=alpha<<|red<<|green<<|blue;
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/27164.html