Java 不旋转位图
我想以特定角度旋转位图,即Java 不旋转位图,java,android,Java,Android,我想以特定角度旋转位图,即angle=meulerZ if (noseBasePos != null) { float width = op.getWidth()/2; float height = op.getHeight()/1.35f; int centrex = (int) (noseBasePos.x - width); int centrey = (int) (noseBasePos.y - height); Matrix mat = new
angle=meulerZ
if (noseBasePos != null) {
float width = op.getWidth()/2;
float height = op.getHeight()/1.35f;
int centrex = (int) (noseBasePos.x - width);
int centrey = (int) (noseBasePos.y - height);
Matrix mat = new Matrix();
mat.setRotate(meulerZ);
mat.postRotate(meulerZ);
mat.setTranslate(centrex,centrey);
op = Bitmap.createBitmap(op, 0,0,op.getWidth(), op.getHeight(), mat, true);
canvas.drawBitmap(op,mat,null);
}
而且。。。有什么问题?而且。。。问题是什么?角度是90度?实际上我正在尝试开发一个面部过滤应用程序,我正在正确地在面部绘制位图…现在我想以头部倾斜的角度旋转位图。所以角度不是特定的…meuler z是头部倾斜的角度。。。有什么问题?而且。。。问题是什么?角度是90度?