Android PNG透明渐变背景图片失真问题
2012-04-13 10:34
435 查看
zz: http://hi.baidu.com/%CE%DE%D0%C4%B1%B1%BE%A9/blog/item/e76270cdcb77bd0e00e928ea.html
The artefact you are seeing is known as "banding" and it is aconsequence of your display being 16bits perpixel.(OnAndroid 2.2 and lower the default pixel format is 16-bit(565/PixelFormat.OPAQUE ).)
The best way to resolve this is to add some "noise" to your imageasset in Photoshop or Paint.NET.
Alternatively you can set your window to be 32bpp with thefollowing line added to your activity'sonCreate(),between super.onCreate() and setContentView().:
getWindow().setFormat(PixelFormat.RGBA_8888);或者PixelFormat.TRANSLUCENT
在onCreate()中直接加:
getWindow().setFormat(PixelFormat.RGBA_8888);或者PixelFormat.TRANSLUCENT 即可解决。
RGBA_8888为android的一种32位颜色格式,R,G,B,A分别用八位表示,Android默认格式是PixelFormat.OPAQUE,其是不带Alpha值的。设置之后可以看到图片的显示效果就和在PC上看到一样,不会出现带状的轮廓线了。
The artefact you are seeing is known as "banding" and it is aconsequence of your display being 16bits perpixel.(OnAndroid 2.2 and lower the default pixel format is 16-bit(565/PixelFormat.OPAQUE ).)
The best way to resolve this is to add some "noise" to your imageasset in Photoshop or Paint.NET.
Alternatively you can set your window to be 32bpp with thefollowing line added to your activity'sonCreate(),between super.onCreate() and setContentView().:
getWindow().setFormat(PixelFormat.RGBA_8888);或者PixelFormat.TRANSLUCENT
在onCreate()中直接加:
getWindow().setFormat(PixelFormat.RGBA_8888);或者PixelFormat.TRANSLUCENT 即可解决。
RGBA_8888为android的一种32位颜色格式,R,G,B,A分别用八位表示,Android默认格式是PixelFormat.OPAQUE,其是不带Alpha值的。设置之后可以看到图片的显示效果就和在PC上看到一样,不会出现带状的轮廓线了。
相关文章推荐
- Android PNG渐变背景图片失真问题
- Android PNG渐变背景图片失真问题 getWindow().setFormat(PixelFormat.RGBA_8888);
- Android PNG渐变背景图片失真问题
- Android PNG渐变背景图片失真问题
- Android PNG渐变背景图片失真问题
- Android PNG渐变背景图片失真问题
- Android PNG渐变背景图片失真问题
- Android PNG渐变背景图片失真问题 getWindow().setFormat(PixelFormat.RGBA_8888);
- Android PNG渐变背景图片失真问题 getWindow().setFormat(PixelFormat.RGBA_8888);
- Android PNG渐变背景图片失真问题
- roid PNG渐变背景图片失真问题
- DD_belatedPNG.js解决透明PNG图片背景灰色问题(DD_belatedPNG.js下载)
- jQuery解决IE6下PNG图片背景透明问题
- Android-加载透明PNG图片变黑的问题
- 解决IE6下png图片文件背景不透明的问题
- IE6下png图片和背景图片透明问题解决方法
- 【转】CSS解决IE6下PNG图片背景不透明的问题
- 解决IE6png背景图片透明的问题
- 基于jQuery IE6下PNG图片背景透明问题解决方法
- Java裁剪压缩PNG图片,透明背景色变黑问题解决