Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 旋转双面图像_Android_Matrix_Camera_Image Rotation - Fatal编程技术网

Android 旋转双面图像

Android 旋转双面图像,android,matrix,camera,image-rotation,Android,Matrix,Camera,Image Rotation,请帮助旋转双面图像(如硬币)-侧面交换动画,当第一个图像可见时,第二个图像不可见。当我旋转图像时,直到旋转角度小于90度,我显示第一个图像,否则显示第二个图像 现在,它在Y轴(A)上旋转,但我需要在旋转图像(B)的中心轴上旋转图像 转换: long aniAngle = (System.currentTimeMillis() - animationStart)*180/ANIMATION_TIME; aniCamera.save(); if(aniAngle

请帮助旋转双面图像(如硬币)-侧面交换动画,当第一个图像可见时,第二个图像不可见。当我旋转图像时,直到旋转角度小于90度,我显示第一个图像,否则显示第二个图像

现在,它在Y轴(A)上旋转,但我需要在旋转图像(B)的中心轴上旋转图像

转换:

long aniAngle = (System.currentTimeMillis() - animationStart)*180/ANIMATION_TIME;
     aniCamera.save();

            if(aniAngle <= 90)
            {                   
                aniCamera.rotateY(aniAngle); // angle of current rotation
                aniCamera.getMatrix(aniMatrix);
                                    aniCamera.restore();

                int centerX = x + image.getWidth()/2;
                int centerY = y + iamge.getHeight()/2;              

                aniMatrix.preTranslate(-centerX, -centerY);
                aniMatrix.postTranslate(centerX, centerY);
                                    canvas.save();
                                    canvas.concat(aniMatrix);
  Bitmap image = angle < 90 ? image1 : image2;
 if(image == image2)
    angle = 180 - angle; // second image goes from rotated state to normal - degrees of rotation should decrease during animation

如果你解决了这个问题,你能在这里发布你的答案吗?因为我也被困在这个问题上。。。!!!
        c.rotate(angle); // angle of rotation non animated image        

        c.drawBitmap(image, -image.getWidth()/2, -image.getHeight()/2, null);