0
내 표면보기에 문제가 있습니다. 사실 내가 표면보기에 어떤 물건을 그릴 때 (onMoving) 그리기 (show)가 아니지만 표면보기에서 손가락을 놓으면 그림이 그려집니다. 그래서 어느 누구든지 그것을 풀 수 있습니다.안 드 로이드의 표면보기 캔버스에서 그리는 방법
내 코드는 ...............
public boolean onTouch(View view, MotionEvent motionEvent) {
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){
currentDrawingPath = new DrawingPath();
currentDrawingPath.paint = currentPaint;
currentDrawingPath.path = new Path();
currentBrush.mouseDown(currentDrawingPath.path, motionEvent.getX(), motionEvent.getY());
}else if(motionEvent.getAction() == MotionEvent.ACTION_MOVE){
currentBrush.mouseMove(currentDrawingPath.path, motionEvent.getX(), motionEvent.getY());
}else if(motionEvent.getAction() == MotionEvent.ACTION_UP){
currentBrush.mouseUp(currentDrawingPath.path, motionEvent.getX(), motionEvent.getY());
drawingSurface.addDrawingPath(currentDrawingPath);
}
return true;
}
감사를 시도하지만 완벽하게 작동하지 않습니다, 너는 그것을 시도했다. –