Contrary to your expectation, methods of View
doesn't work well.
GLSurfaceView punches a hole to display underneath surface. Actually it has only transparent pixels.
If you want to rotate your image, you have to use OpenGL operations.
Question
I try to use setRotation() on my GLSurfaceView, but the view seems not rotate around the pivot which is the center of the screen. the code like below:
class MyGLSurfaceView extends GLSurfaceView {
private float mCurRotation = 0.0f;
@Override
public boolean onTouchEvent(MotionEvent e) {
mCurRotation = mCurRotation + 10;
setRotation(mCurRotation);
}
}
Is there any body know the reason and teach me how to rotate my GLSurfaceView?
Solution
Contrary to your expectation, methods of View
doesn't work well.
GLSurfaceView punches a hole to display underneath surface. Actually it has only transparent pixels.
If you want to rotate your image, you have to use OpenGL operations.