ringa_lee2017-04-17 16:47:28
First of all, Android can only compress integers, not decimal compression. It is impossible to compress the image to a width of 720
Secondly, the image is usually reduced to a photo smaller than 720 before displaying it. The area less than 720 can be left empty. Draw the default background color, you can crop it, etc., depending on the specific situation
黄舟2017-04-17 16:47:28
Bitmap bitmap = getCompressForQualitySize(os, (int) sampleSize);
ByteArrayOutputStream osSecond = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, options, osSecond);
Use equal scaling, get it first Just set the width and height of the image and then scale it down to 720, but there may be some deviations