Android学习札记18:Drawable中的setDither()方法
16lz
2021-12-04
4.0.4 r1.2中android.graphics.drawable.Drawable源代码
Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component. This can improve the look on those devices, but can also slow down the drawing a little.public void setDither(boolean dither) {}
4.0.4 r1.2中android.graphics.drawable.BitmapDrawable源代码
@Overridepublic void setDither(boolean dither) {mBitmapState.mPaint.setDither(dither);invalidateSelf();}
4.0.4 r1.2中android.graphics.Paint源代码
Helper for setFlags(), setting or clearing the DITHER_FLAG bit Dithering affects how colors that are higher precision than the device are down-sampled. No dithering is generally faster, but higher precision colors are just truncated down (e.g. 8888 -> 565). Dithering tries to distribute the error inherent in this process, to reduce the visual artifacts.Parameters:dither true to set the dithering bit in flags, false to clear itpublic native void setDither(boolean dither);
最后调用本地类库进行处理。
更多相关文章
- Android(安卓)WebView
- Android(安卓)实现简单的刮刮乐
- Android中的共享设置(SharedPreferences)
- Intent在Android中的几种用法
- Android(安卓)GPS架构分析(二)
- Android(安卓)通过Intent调用系统功能和Action动作和服务广播【
- android入门级小软件身高体重计算器源代码,初学者可以看看~
- Android(安卓)Activity的生命周期
- Android中调用startActivity结果导致:java.lang.RuntimeException