全白 int[] pix = new int[picw * pich];
for (int y = 0; y < pich; y++)
for (int x = 0; x < picw; x++)
{
int index = y * picw + x;
int r = ((pix[index] >> 16) & 0xff)|0xff;
int g = ((pix[index] >> 8) & 0xff)|0xff;
int b =( pix[index] & 0xff)|0xff;
pix[index] = 0xff000000 | (r << 16) | (g << 8) | b;
}
bm1.setPixels(pix, 0, picw, 0, 0, picw, pich);
BitmapDrawable bmp11=new BitmapDrawable(bm1);全黑就简单了:
for (int y = 0; y < pich; y++)
for (int x = 0; x < picw; x++)
{
int index = y * picw + x;
//int r = ((pix[index] >> 16) & 0xff)|0xff;
//int g = ((pix[index] >> 8) & 0xff)|0xff;
//int b =( pix[index] & 0xff)|0xff;
// pix[index] = 0xff000000 | (r << 16) | (g << 8) | b;
pix[index] = 0xff000000;
}
bm1.setPixels(pix, 0, picw, 0, 0, picw, pich);
BitmapDrawable bmp11=new BitmapDrawable(bm1);
for (int y = 0; y < pich; y++)
for (int x = 0; x < picw; x++)
{
int index = y * picw + x;
int r = ((pix[index] >> 16) & 0xff)|0xff;
int g = ((pix[index] >> 8) & 0xff)|0xff;
int b =( pix[index] & 0xff)|0xff;
pix[index] = 0xff000000 | (r << 16) | (g << 8) | b;
}
bm1.setPixels(pix, 0, picw, 0, 0, picw, pich);
BitmapDrawable bmp11=new BitmapDrawable(bm1);全黑就简单了:
for (int y = 0; y < pich; y++)
for (int x = 0; x < picw; x++)
{
int index = y * picw + x;
//int r = ((pix[index] >> 16) & 0xff)|0xff;
//int g = ((pix[index] >> 8) & 0xff)|0xff;
//int b =( pix[index] & 0xff)|0xff;
// pix[index] = 0xff000000 | (r << 16) | (g << 8) | b;
pix[index] = 0xff000000;
}
bm1.setPixels(pix, 0, picw, 0, 0, picw, pich);
BitmapDrawable bmp11=new BitmapDrawable(bm1);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货