问题描述
Bitmap bitmap = Bitmap.createBitmap(WIDTH,HEIGHT,Bitmap.Config.ARGB_4444);
for (int y = 0; y < HEIGHT; y++) {
for (int x = 0; x < WIDTH; x++) {
int index = y * WIDTH + x;
bitmap.setPixel(x,y,Color.argb(255,mask[index],0)); // mask is an array of int between 0 and 255
}
}
它正常工作:我得到了位图,但是...此代码确实非常慢。
我尝试将其替换为:
Bitmap bitmap = Bitmap.createBitmap(WIDTH,Bitmap.Config.ARGB_4444);
bitmap.setPixels(mask,WIDTH,HEIGHT);
但这不起作用。我得到黑色图像。
任何人都可以帮忙吗?
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)