title: How to load bitmap from res without resizing?
body: <p>Using this code:</p>
  
  <pre><code>    Drawable blankDrawable = context.getResources().getDrawable(image);
      Bitmap blankBitmap=((BitmapDrawable)blankDrawable).getBitmap();
  </code></pre>
  
  <p>I get a bitmap that is scaled to the density of the context, preserving the physical size of the bitmap (based on its dpi value). So for example, I have a 405x500 bitmap (dpi=96) as a resource. But when I load it on a device, I get a 608x750 image with density=240. I want to load the bitmap without scaling. How do I do that?</p>
  
  <p>This question is very similar to:</p>
  
  <p><a href="https://stackoverflow.com/questions/7361976/how-to-create-a-drawable-from-a-stream-without-resizing-it">How to create a Drawable from a stream without resizing it?</a></p>
  
  <p>However, that solution cannot be used in my case, because I don't have an input stream. All I have is a resource id, and the getDrawable() method does not have parameters for density. Once the bitmap is loaded, it is too late - it was already resized.</p>
  
  <p>Thank you.</p>