Caches BitmapData in memory. Each BitmapData object may be saved with its own key, such as the URL where the original image file is located.

Available since

1.0.0

.

Constructor

@:value({ maxUnretained : 0x7FFFFFFF })new(maxUnretained:Int = 0x7FFFFFFF)

Creates a new BitmapDataCache object with the given arguments.

Available since

1.0.0

.

Variables

maxUnretained:Int

Limits the number of unretained BitmapData objeccts that may be stored in memory. The BitmapData objects retained least recently will be disposed, if there are too many.

Available since

1.0.0

.

Methods

@:value({ retain : true })addBitmapData(key:String, bitmapData:BitmapData, retain:Bool = true):Void

Saves a BitmapData object, and associates it with a specific key.

Available since

1.0.0

.

See also:

dispose():Void

Disposes the BitmapData cache, including all BitmapData objects (even if they are retained, so be careful!).

Available since

1.0.0

.

getRetainCount(key:String):Int

Returns how many times the BitmapData object associated with the specified key has currently been retained.

Available since

1.0.0

.

hasTexture(key:String):Bool

Indicates if a BitmapData object is associated with the specified key.

Available since

1.0.0

.

releaseBitmapData(key:String):Void

Releases a retained BitmapData object.

Available since

1.0.0

.

See also:

@:value({ dispose : false })removeBitmapData(key:String, dispose:Bool = false):Void

Removes a specific key from the cache, and optionally disposes the BitmapData object associated with the key.

Available since

1.0.0

.

See also:

retainBitmapData(key:String):BitmapData

Gets the BitmapData object associated with the specified key, and increments the retain count for the BitmapData object. Always remember to call releaseBitmapData() when finished with a retained BitmapData object.

Available since

1.0.0

.

See also: