2013-01-09 3 views
2

캡처 된 이미지가 가로 위치에 저장되어 있으므로 Potrait로 변경하고 싶습니다.비트 맵을 사용하지 않고 Android에서 이미지를 회전하는 방법은 무엇입니까?

비트 맵을 사용하지 않고이를 수행하는 방법은 무엇입니까? 아래 코드 이미지를 사용하면 비트 맵을 사용하여 손상된 부분을 제거 할 수 있습니다.

내 코드는 다음과 같습니다 예를 들어 RotateAnimation 에서

Bitmap Out = null; 
Bitmap Output = null; 

Out = BitmapFactory.decodeByteArray(data, 0, data.length); 
int w = Out.getWidth(); 
int h = Out.getHeight(); 
Matrix mtx = new Matrix(); 
mtx.postRotate(90); 

      Output = Bitmap.createBitmap(Out, 0, 0, w, h, mtx, true); 
       image = bitmaptoByte(Output); 
+1

당신이 그것을에 애니메이션을 적용 할 수 있습니다,하지만 경우 비트 맵을 통해 사용해야하는 실제 이미지가 회전되기를 원합니다. – Budius

+0

카메라에 지정된 방향으로 이미지를 저장하도록 지시 할 수는 있지만이 속성을 찾지 못했습니다. –

+0

@Budius Bitmap 이미지를 사용하는 경우 손상된 부분 만 가져 오면 Bitmap없이 수행하고 싶습니다. – Baskar

답변

0

봐, 내가 두 번째 손을 회전 : 그것은 레이아웃의 경우

public RotateAnimation createAnimation(float time) { 
     RotateAnimation rotateAnimation = new RotateAnimation(time, time, Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF, 0.5f); 
     rotateAnimation.setFillAfter(true); 
     return rotateAnimation; 

    public void runSec(float shour) { 
     csecond.startAnimation(createAnimation(shour*6)); 
    } 
관련 문제