android-destroyDrawingCache
2016-07-14 13:33
351 查看
destroyDrawingCache
Added in API level 1void destroyDrawingCache ()
Frees the resources used by the drawing cache. If you call
buildDrawingCache()manually
without calling
setDrawingCacheEnabled(true), you should cleanup
the cache with this method afterwards.释放的资源使用的绘图缓存。如果你调用buildDrawingCache()手动没有调用setDrawingCacheEnabled(真正的),你应该清理缓存使用此方法。
See also:
setDrawingCacheEnabled(boolean)
buildDrawingCache()
getDrawingCache()
setDrawingCacheEnabled
Added in API level 1void setDrawingCacheEnabled (boolean enabled)
Enables or disables the drawing cache. When the drawing cache is enabled, the next call to
getDrawingCache()or
buildDrawingCache()will
draw the view in a bitmap. Calling
draw(android.graphics.Canvas)will
not draw from the cache when the cache is enabled. To benefit from the cache, you must request the drawing cache by calling
getDrawingCache()and
draw it on screen if the returned bitmap is not null.启用或禁用绘图缓存。启用绘图缓存时,下一个调用getDrawingCache()或buildDrawingCache()将一个位图中的视图。调用画(android.graphics.Canvas)不会从缓存启用缓存时。从缓存中获益,您必须请求绘图缓存通过调用getDrawingCache()和画在屏幕上返回的位图(如果不为空。
Enabling the drawing cache is similar to
setting a layerwhen
hardware acceleration is turned off. When hardware acceleration is turned on, enabling the drawing cache has no effect on rendering because the system uses a different mechanism for acceleration which ignores the flag. If you want to use a Bitmap for the view,
even when hardware acceleration is enabled, see
setLayerType(int, android.graphics.Paint)for information on how to enable software and hardware layers.使绘图缓存类似于当关闭硬件加速设置一层。当开启硬件加速,使绘图缓存对渲染,因为没有影响系统使用不同的机制来加速它忽略了国旗。如果你想使用一个位图的观点,即使启用硬件加速,看到setLayerType(int,android.graphics.Paint)如何启用软件和硬件层的信息。
This API can be used to manually generate a bitmap copy of this view, by setting the flag to
trueand calling
getDrawingCache().
Parameters | |
---|---|
enabled | boolean: true to enable the drawing cache, false otherwise |
isDrawingCacheEnabled()
getDrawingCache()
buildDrawingCache()
setLayerType(int, android.graphics.Paint)
isDrawingCacheEnabled
Added in API level 1boolean isDrawingCacheEnabled ()
Indicates whether the drawing cache is enabled for this view.显示绘图缓存是否支持这一观点。
Returns | |
---|---|
boolean | true if the drawing cache is enabled |
setDrawingCacheEnabled(boolean)
getDrawingCache()
buildDrawingCache
Added in API level 1void buildDrawingCache ()
Calling this method is equivalent to calling
buildDrawingCache(false).调用该方法相当于调用buildDrawingCache(假)。
See also:
buildDrawingCache(boolean)
getDrawingCache
Added in API level 1Bitmap getDrawingCache ()
Calling this method is equivalent to calling
getDrawingCache(false).
Returns | |
---|---|
Bitmap | A non-scaled bitmap representing this view or null if cache is disabled. |
getDrawingCache(boolean)
相关文章推荐
- Java-Android【2】-弹出对话框
- ImageLoader源码分析
- Android实现推送方式解决方案
- gridview设置第一行距顶部的距离
- android提醒闹铃
- Android Studio 使用技巧
- 详谈Activity生命周期函数调用时机
- RecyclerView简单使用介绍
- SuperQQ小项目遇到的问题(1)
- Ecplise项目和AndroidStudio项目之间的转换
- Android Studio show line numbers
- Android Studio中的.gradle文件解读
- Android 5.x support.design.widget---Snackbar
- Android MVC
- android developer tiny share-20160714
- android developer tiny share-20160714
- Android自定义View制作动态炫酷按钮实例解析
- Android 编程小问题及Android studio小技巧
- Android 登录Web 时对cookie 处理
- Android提高第十九篇之"多方向"抽屉