App
Public Member Functions | Protected Attributes | List of all members
mhr.app.utils.ImgLoader Class Reference

Pomocná třída pro načítání obrázků z assets. More...

Public Member Functions

 ImgLoader (Context context)
 
Bitmap loadAndroidBitmap (String path)
 

Protected Attributes

Context context
 
AssetManager assetManager
 

Detailed Description

Pomocná třída pro načítání obrázků z assets.

Definition at line 14 of file ImgLoader.java.

Constructor & Destructor Documentation

mhr.app.utils.ImgLoader.ImgLoader ( Context  context)
inline

Definition at line 19 of file ImgLoader.java.

{
this.context = context;
this.assetManager = context.getAssets();
}

Member Function Documentation

Bitmap mhr.app.utils.ImgLoader.loadAndroidBitmap ( String  path)
inline

Načte bitmapu z assets se zadanou cestou.

Parameters
path
Returns

Definition at line 29 of file ImgLoader.java.

{
InputStream is = null;
Bitmap res = null;
try {
is = assetManager.open(path);
BitmapFactory.Options o = new BitmapFactory.Options();
o.inScaled = false;
res = BitmapFactory.decodeStream(is, null, o);
} catch (IOException e) {
return null;
} finally {
if (is != null) {
try {
is.close();
} catch (IOException e) {
return null;
}
}
}
return res;
}

Member Data Documentation

AssetManager mhr.app.utils.ImgLoader.assetManager
protected

Definition at line 17 of file ImgLoader.java.

Context mhr.app.utils.ImgLoader.context
protected

Definition at line 16 of file ImgLoader.java.


The documentation for this class was generated from the following file: