android load image to maximum allowable size

view story

http://stackoverflow.com – I am making a drawing app such that user can choose to load pictures from the gallery and further draw on it. However, if the size of the photo is greater than the screen, it can only show part of the picture. public void load_pic(String picturePath) // load a picture from gallery { bitmap = (BitmapFactory.decodeFile(picturePath)).copy(Bitmap.Config.ARGB_8888, true); bitmapCanvas = new Canvas(bitmap); invalidate(); } How could i code such that the picture can either load in such that can fit either maximium allowable screen width or height, or load in such that (HowTos)