Loading and Examining Bitmaps

The Bitmap class will become our best friend. We load a bitmap from a file by using the BitmapFactory singleton. As we store our images in the form of assets, let's see how we can load an image from the assets directory InputStream inputStream assetManager.open(bob.png) Bitmap bitmap The Bitmap class itself has a couple of methods that are of interest to us. First we want to get to know its width and height in pixels int width bitmap.getWidth() int height bitmap.getHeight() The next thing we...