public static final Bitmap createRGBImage(Bitmap bitmap,int color)
{int bitmap_w=bitmap.getWidth();
int bitmap_h=bitmap.getHeight();
int[] arrayColor=new int[bitmap_w*bitmap_h];
int count=0;
for(int i=0;i<bitmap_h;i++){
for(int j=0;j<bitmap_w;j++){
int color1=bitmap.getPixel(j,i);
//这里也可以取出 R G B 可以扩展一下 做更多的处理,
//暂时我只是要处理除了透明的颜色,改变其他的颜色
if(color1!=0){
}else{
color1=color;
}
arrayColor[count]=color;
count++;
}
}
bitmap = Bitmap.createBitmap( arrayColor, bitmap_w, bitmap_h, Config.ARGB_4444 );
return bitmap;
}
版权声明:本文为博主原创文章,未经博主允许不得转载。