getHolder().setFormat(PixelFormat.RGBA_888);
Options options = new BitmapFactory.Options();
options.inDither=true;
options.inScaled = true;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inPurgeable=true;
当使用上面的代码,我得到下面的结果.........
无色带我的平板设备
上测试移动
明显的颜色条纹(三星Galaxy ACE) getHolder().setFormat(PixelFormat.RGBA_888);
Options options = new BitmapFactory.Options();
options.inDither=true;
options.inScaled = true;
options.inPreferredConfig = Bitmap.Config.ARGB_565;
options.inPurgeable=true;上
在我的平板电脑无色带
在银河王牌
的结果相同Noticible色带如上 getHolder().setFormat(PixelFormat.RGB_565);
Options options = new BitmapFactory.Options();
options.inDither=true;
options.inScaled = true;
options.inPreferredConfig = Bitmap.Config.RGB_565;
options.inPurgeable=true;
色带上我的平板电脑
色带上SG王牌 getHolder().setFormat(PixelFormat.RGB_565);
Options options = new BitmapFactory.Options();
options.inDither=true;
options.inScaled = true;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
options.inPurgeable=true;对
色带上我的平板电脑
色带的SG王牌
所以,综上所述,只有PixelFormat.xxxx部分似乎任何区别。我的理解是,这是设置持有人的颜色格式。这将影响绘制的所有内容。 (即,所有内容都将采用该格式)。
有人可以解释下列行的用途吗?
options.inPreferredConfig = Bitmap.Config.xxxxxxx
这似乎并没有对已经绘制的位图任何影响。
性能是至关重要的,所以我可能必须更改我的原始PNG文件,以便它们没有渐变(即将它们绘制为RGB565 - 这是可取的,还是应该坚持使用8888?)或应该抖动排序那个出来? (因为你可以看到,我已启用它,但似乎没有帮助)。
任何想法为什么在Ace上总会出现这种情况?它可能是硬件限制吗?
谢谢这一切都很混乱。 (PS我已阅读过官方指南,在将问题发布到SO以及查看其他相关的SO问题之前,我经常会看到这一点,但官方指南(情况经常是这样),不会为我清楚这一点,我无法通过其他问题找到答案,所以,如果它已经在这里,请致歉)。
2013-03-02
Zippy