Kofax Mobile SDK API Reference
Public Member Functions | List of all members
ContextImageStorage Class Reference
Inheritance diagram for ContextImageStorage:
IImageStorage

Public Member Functions

 ContextImageStorage ()
 
void setImage (Bitmap image, String id)
 
Bitmap getImage (String id)
 
Bitmap removeImage (String id)
 

Detailed Description

An implementation of IImageStorage that uses a static hashmap to store images. It is important to note that memory leaks will occur if images stored here are not properly recycled, and references cleared as soon as possible.

Constructor & Destructor Documentation

Member Function Documentation

Bitmap getImage ( String  id)

Get a reference to an image of the given Id. This implementation returns a direct reference to image in memory. Calling Bitmap.recycle() will recycle the bitmap for all references.

Parameters
idThe id of the image to retrieve
Returns
A bitmap, or null if the image of the given id does not exist in storage

Implements IImageStorage.

Bitmap removeImage ( String  id)

Retrieves and removes the image of the given id from storage. The returned image must be recycled by the caller

Parameters
idThe id of the image to remove from storage
Returns
The image associated with the specified id or null if no image for the specified id was found

Implements IImageStorage.

void setImage ( Bitmap  image,
String  id 
)

Store or overwrite an image with the given Id. Null is a valid value.

Parameters
imageThe image to store
idThe id of the image when storing, for later retrieval

Implements IImageStorage.


The documentation for this class was generated from the following file:
Untitled Document © 2018 Kofax, Inc. All rights reserved. Use is subject to license terms.