Classes
Global | Description |
---|---|
ImageCache | ImageCache |
Functions
Global | Description |
---|---|
initialize() | 初始化图像缓存。 Initialize the image cache. |
add(key, value) | 向图像缓存中添加位图。 Adds a bitmap to the image cache. |
get(key) ⇒ Bitmap | null | 从图像缓存中获取位图。 Gets a bitmap from the image cache. |
reserve(key, value, reservationId) | 在图像缓存中保留位图。 Reserves a bitmap in the image cache. |
releaseReservation(reservationId) | 释放具有指定保留ID的项目。 Releases items with the specified reservation ID. |
isReady() ⇒ Boolean | 检查所有缓存的位图是否已准备好。 Checks whether all cached bitmaps are ready. |
getErrorBitmap() ⇒ Bitmap | null | 从缓存中获取第一个错误位图。 Gets the first error bitmap from the cache. |
ImageCache
ImageCache
Kind: global class
- ImageCache
- new ImageCache()
- .limit :
Number
new ImageCache()
存储图像位图的缓存。
Cache for storing image bitmaps.
ImageCache.limit : Number
缓存大小限制(字节)。
The cache size limit in bytes.
Kind: static property of ImageCache
Default: 10485760
Properties
Name |
---|
limit |
initialize()
初始化图像缓存。
Initialize the image cache.
Kind: global function
add(key, value)
向图像缓存中添加位图。
Adds a bitmap to the image cache.
Kind: global function
Param | Type | Description |
---|---|---|
key | String | 缓存键 / The cache key |
value | Bitmap | 要缓存的位图 / The bitmap to cache |
get(key) ⇒ Bitmap
| null
从图像缓存中获取位图。
Gets a bitmap from the image cache.
Kind: global function
Returns: Bitmap
| null
- 缓存的位图或找不到时返回 null / The cached bitmap or null if not found
Param | Type | Description |
---|---|---|
key | String | 缓存键 / The cache key |
reserve(key, value, reservationId)
在图像缓存中保留位图。
Reserves a bitmap in the image cache.
Kind: global function
Param | Type | Description |
---|---|---|
key | String | 缓存键 / The cache key |
value | Bitmap | 要保留的位图 / The bitmap to reserve |
reservationId | String | 保留 ID / The reservation ID |
releaseReservation(reservationId)
释放具有指定保留 ID 的项目。
Releases items with the specified reservation ID.
Kind: global function
Param | Type | Description |
---|---|---|
reservationId | String | 要释放的保留 ID / The reservation ID to release |
isReady() ⇒ Boolean
检查所有缓存的位图是否已准备好。
Checks whether all cached bitmaps are ready.
Kind: global function
Returns: Boolean
- 如果所有缓存的位图都准备好则返回 true / True if all cached bitmaps are ready
getErrorBitmap() ⇒ Bitmap
| null
从缓存中获取第一个错误位图。
Gets the first error bitmap from the cache.
Kind: global function
Returns: Bitmap
| null
- 错误位图或找不到错误时返回 null / The error bitmap or null if no error found