所有的操作都是通过流完成的、转换成流后进行处理压缩、然后在吧处理好的流转换成Bitmap
尺寸压缩修改,只是修改该图片的宽高。并不是对该图片进行裁剪
file文件获取图片资源
Bitmap直接压缩处理
解析流
Bitmap bitmap=BitmapFactory.decodeStream(InputStream is, Rect outPadding, Options opts)
压缩Bitmap转换成输出流
bitmap.compress(CompressFormat format, int quality, OutputStream stream);//100表示不压缩,质量最好
裁剪Bitmap
Bitmap.createBitmap(@NonNull Bitmap source, int x, int y, int width, int height,@Nullable Matrix m, boolean filter)