toImageResource

Convert a bitmap to a ImageResource.

Ensures it uses RGB_565 encoding, then generates an ImageResource with the correct width and height.