Padding out a bitmap to make it a power of two
<p>I have a bunch of images of dimension 480x800. The intention is that these will fill the entire screen of the device.</p>

<p>I would like to take the image and use <code>createScaledBitmap()</code> to resize the image to fit the screen exactly. I then want to put this bitmap inside another bitmap (not stretch it), which will have dimensions that are a power of two.</p>

<p>So for example, if the screen size is 320x480 I resize my 480x800 image to be 320x480. I then want to place this 320x480 image inside of a bitmap that is 512x512 so that the original image is nested in the top left corner (with the extra space being blank). </p>

<p>How can I achieve this on android? I have gotten so far as to resize the image to fit the screen exactly, but not making the power of two bitmap and filling it.</p>
