android-destroyDrawingCache

destroyDrawingCache

Added in  API level 1
void 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

Added in  API level 1
void 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 layer when 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 true and calling getDrawingCache().

Parameters
enabled boolean: true to enable the drawing cache, false otherwise

isDrawingCacheEnabled

Added in  API level 1
boolean isDrawingCacheEnabled ()

Indicates whether the drawing cache is enabled for this view.显示绘图缓存是否支持这一观点。

Returns
boolean true if the drawing cache is enabled

buildDrawingCache

Added in  API level 1
void buildDrawingCache ()

Calling this method is equivalent to calling buildDrawingCache(false).调用该方法相当于调用buildDrawingCache(假)。

getDrawingCache

Added in  API level 1
Bitmap 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.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值