The array has to be x*y in size to store a bitmap with x columns and y rows. That's basically the whole trick. It's difficult to give an example of this, because it's really pretty straight forward. You can take (for example) an int[] returned by a PixelGrabber from an image.
Keep in mind that using this method in hardware requires a texture upload every time => slowness!