84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
小伙看你根骨奇佳,潜力无限,来学PHP伐。
你可以先用inSampleSize获得一张近似大小的图片,再用Matrix进行缩放到指定大小嘛╮(╯_╰)╭
inSampleSize
Matrix
╮(╯_╰)╭
首先,Android上只能整数压缩,不能小数压缩,图片不可能刚好压缩至宽度为720其次,一般是图片缩小至小于720的照片之后,再进行显示,不够720的地方可以空着,可以绘制默认底色,可以裁剪等等,视具体情况而定
Bitmap bitmap = getCompressForQualitySize(os, (int) sampleSize);ByteArrayOutputStream osSecond = new ByteArrayOutputStream();bitmap.compress(Bitmap.CompressFormat.JPEG, options, osSecond);用等比例缩放来做吧,先获取图片的宽高,然后按照比例缩小到 720就行了,但是可能会有些偏差
你可以先用
inSampleSize
获得一张近似大小的图片,再用Matrix
进行缩放到指定大小嘛╮(╯_╰)╭
首先,Android上只能整数压缩,不能小数压缩,图片不可能刚好压缩至宽度为720
其次,一般是图片缩小至小于720的照片之后,再进行显示,不够720的地方可以空着,可以绘制默认底色,可以裁剪等等,视具体情况而定
Bitmap bitmap = getCompressForQualitySize(os, (int) sampleSize);
ByteArrayOutputStream osSecond = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, options, osSecond);
用等比例缩放来做吧,先获取图片的宽高,然后按照比例缩小到 720就行了,但是可能会有些偏差