Android/BitmapFactory

uyse the BitmapFactory to reduce or manipulate an image before displaying

BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options; bmpFactoryOptions.inSampleSize = 8; Bitmap bmp = BitmapFactory.decodeFile(imageFilePath, bmpFactoryOptions); imv.setImageBitmap(bmp);

BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options; bmpFactoryOptions.inJustDecodeBounds = true; Bitmap bmp = BitmapFactory.decodeFile(imageFilePath, bmpFactoryOptions); int heightRatio = (int)Math.ceil(bmpFactoryOptions.outHeight/(float)dh); int widthRatio = (int)Math.ceil(bmpFactoryOptions.outWidth/(float)dw); Log.v("HEIGHTRATIO",""+heightRatio); Log.v("WIDTHRATIO",""+widthRatio);

the code for using the BitmapFactory example is given in Pro Android Media