title: How to calculate Bitmap pixel size in Android
body: <p>I loaded a 640 x 480 (in px) jpg image from res using Bitmap. </p>
  
  <pre><code>bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.bmp);
  </code></pre>
  
  <p>But I found:</p>
  
  <ul>
  <li>the value of bitmap.getWitdh() is 1280; </li>
  <li>the value of bitmap.getHeight() is 960;</li>
  <li>the value of bitmap.getRowBytes() is 2560;</li>
  </ul>
  
  <p>Why?</p>