width = imgBit.getWidth();
height = imgBit.getHeight();
Rect src = new Rect();
Rect dst = new Rect();
src.left=inx*width/row;
src.top=iny*height/line;
Matrix matrix=new Matrix();
matrix.setTranslate(src.top, src.left);
Bitmap tranBitmap=Bitmap.createBitmap(imgBit,src.top,src.left,(width/row),(height/line),
matrix,true);
g.drawBitmap(tranBitmap, matrix, paint);
return imgBit;
我已经用Bitmap剪裁图片,返回的是tranBitmap的Bitmap类型。有没有方法可直接用Matrix类剪裁图片,得到Matrix类型?
------解决方案--------------------
Matrix的几个参数 scale skew trans
这分别是缩放、扭曲和位移的,不可能剪切的