2011-07-06 5 views
1

화면 중간에서 끝까지 비트 맵을 이동해야합니다. 캔버스를 사용하고 있는데 다른 비트 맵 위에 비트 맵을 그립니다. 상위 비트 맵 만 이동해야합니다.안드로이드에서 한 포인트에서 다른 포인트로 비트 맵을 이동하는 방법

pcanvas = new Canvas(); 

pcanvas.setBitmap(bitmap); 

pcanvas.drawBitmap(myBitmap, 0, 0, null); 

pcanvas.drawBitmap(bmp, stDropCurPoint.x, stDropCurPoint.y, null); 

비트 맵 bmp를 이동하려고합니다. 현재 아래 코드를 사용하여 비트 맵을 이동하지만 작동하지 않습니다.

if (start == true) 
{ 
     pcanvas.drawBitmap(bmp, stDropCurPoint.x, stDropCurPoint.y, null); 
     start = false; 
    } 
    else 
    { 
     pcanvas.save(); 
     pcanvas.clipRect(0,0,stDropCurPoint.x,stDropCurPoint.y);      
     pcanvas.restore();    

    } 

이 문제를 해결하는 방법을 알려주세요. 미리 감사드립니다.

파반

답변

1

의 clipRect() 당신이 아마 찾고있는 것은 ... 도움이되지 않습니다 translate()

관련 문제