Bizarre ImageView Bitmap Handling
<p>I've encountered totally bizarre behavior in the way Android loads bitmaps into ImageView. For example, I have a 500x313 image file called urimg_01.jpg. With this code:</p>

<pre><code>        img.setImageResource(R.drawable.urimg_01);
        Bitmap bitmap = ((BitmapDrawable) img.getDrawable()).getBitmap();
        Log.v(TAG,"---------------------&gt; bitmap width = "+bitmap.getWidth());
        Log.v(TAG,"---------------------&gt; bitmap height = "+bitmap.getHeight());
</code></pre>

<p>the ImageView bitmap is 750x470. (I have a Nexus S with 480x800 display.)</p>

<p>With this code, which reads a copy of the same file located in getFilesDir():</p>

<pre><code>            Log.v(TAG,"image file is "+filelist[0].getAbsolutePath());
            FileInputStream fis = new FileInputStream(filelist[0]);
            FileDescriptor fd = fis.getFD();
            Bitmap bitmap = BitmapFactory.decodeFileDescriptor(fd);
            if (bitmap != null) {
                Log.v(TAG,"---------------------&gt; bitmap width = "+bitmap.getWidth());
                Log.v(TAG,"---------------------&gt; bitmap height = "+bitmap.getHeight());
                img.setImageBitmap(bitmap);
                fis.close();
            }
</code></pre>

<p>the ImageView bitmap is 500x313, as expected.</p>

<p>In the case of setImageResource(), where the devil is it getting 750x470 from?? And how do I get it to use the correct dimensions for resources in drawable?</p>
