Code example for ImageView

Methods: getLayoutParams

0
     */ 
    private void transformImageBitmap(ImageView child, Transformation t, int angle) {
        this.mCamera.save();
 
        final Matrix matrix = t.getMatrix();
        final int imageHeight = child.getLayoutParams().height;
        final int imageWidth = child.getLayoutParams().width;
        final int rotation = Math.abs(angle);
 
        this.mCamera.translate(0.0f, 0.0f, 100.0f);
 
        // 拡大率の算出 
        if (rotation < this.mMaxRotationAngle) {
            float zoom = (float) (this.mMaxZoom + (rotation * 1.5));
            this.mCamera.translate(0.0f, 0.0f, zoom);
        } 
 
        this.mCamera.rotateY(angle);
        this.mCamera.getMatrix(matrix);
        matrix.preTranslate(-(imageWidth / 2), -(imageHeight / 2));
        matrix.postTranslate((imageWidth / 2), (imageHeight / 2));