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