Code example for Transformation

Methods: cleargetMatrixsetTransformationType

0
		 
		int childOfCenter = getCenterOfView(child);
		int childWidth = child.getLayoutParams().width;
		int rotateAngle = 0;
		 
		t.clear();
		t.setTransformationType(Transformation.TYPE_MATRIX);
		 
		if(childOfCenter == coverFlowCenter){
			transformationImageBitmap((ImageView)child, t, 0);
		} else { 
			rotateAngle = (int) ((float)(coverFlowCenter - childOfCenter) / childWidth * maxRotationAngle);
			if(Math.abs(rotateAngle) > maxRotationAngle ){
				rotateAngle = rotateAngle < 0 ? -maxRotationAngle : maxRotationAngle;
			} 
			 
			transformationImageBitmap((ImageView)child, t, rotateAngle);
			 
		} 
		 
		 
		return true; 
	} 
 
	/** 
	 * ͼƬЧ������ 
	 * @param View child ͼƬ 
	 * @param Transformation t �������ͣ�Ч���� 
	 * @param int ratate ��ת�Ƕ� 
	 */ 
	private void transformationImageBitmap(ImageView child, Transformation t, int rotate) {
		 
		camera.save();//������
		 
		Matrix imageMatrix = t.getMatrix();
		int rotateAngle = Math.abs(rotate);
		int width = child.getLayoutParams().width;
		int height = child.getLayoutParams().height;
		 
		camera.translate(0, 0, 100);
Stop searching for code, let great code find you!  Add Codota to your java IDE