Android how to scale an image with BitmapFactory Options
问题 I want to decode an image from the SD card with BitmapFactory.decodeFile(path, options). I also want images that are larger than 2048x2048 pixels to be scaled down to at most 2048x2048 (maintaining the proportions). I could do this manually after getting the bitmap, but that would require allocating a large amount of bytes in addition to the ones already allocated. How should i set up my BitmapFactory.Options object to get that effect? Thanks 回答1: Use BitmapFactory.Options.inSampleSize when