Bitmap.createBitmap那个最长参数的方法

来源:互联网 发布:淘宝店铺怎么添加音乐 编辑:程序博客网 时间:2024/05/22 10:31
Bitmap.createBitmap(Bitmap source, int x, int y, int width, int height,Matrix m, boolean filter)

最后一个:filter解释
true if the source should be filtered. Only applies if the matrix contains more than just translation.
当进行的不只是平移变换时,filter参数为true可以进行滤波处理,有助于改善新图像质量;flase时,计算机不做过滤处理。

图片裁剪,可用这个方法:
Bitmap source:要从中截图的原始位图
int x:  起始x坐标
int y:起始y坐标
int width:  要截的图的宽度
int height:要截的图的高度

要想imageView.setImageMatrix()方法起作用,xml得配置android:scaleType="matrix"

matrix.setRotate和matrix.postRotate的区别:
post...:平移、旋转等效果可以叠加在一起;
set...:前一种效果会消失,只有后来的操作,即它会重置Matrix
0 0
原创粉丝点击