Possible Duplicate:
How to convert a Drawable to a Bitmap?
I have just started learning android, so im a newbie
I am trying to create an android application for image processing for my Project
I came accross the blog entry :
http://xjaphx.wordpress.com/2011/06/22/image-processing-brightness-over-image/
I am facing the following problem;
I am unable to create a Bitmap object for my image stored as /res/drawable/pic_1.jpg
I have tried using
Bitmap myBitmap = BitmapFactory.decodeFile("/res/drawable/pic_1.jpg"); and called the function;
public static Bitmap doBrightness(myBitmap, int value) {.........}
but that didnt work;
then I tried,
Bitmap myBitmap = BitmapFactory.decodeFile("/res/drawable/pic_2.jpg");
imageview.setImageBitmap(myBitmap);
without calling the doBrightness()
function.yet,it displays nothing in the imageview.
so I guess BitmapFactory.decodeFile()
is returning null.
so what i wanted to know is, how is it possible to create Bitmap object for an image stored in /res/drawable?