1

I used this code: In onCreate:

imageView.setOnTouchListener((OnTouchListener) this);

And onTouch:

 case MotionEvent.ACTION_MOVE:
                canvas.drawLine(oldX, oldY, event.getX(), event.getY(), paint);
                imageView.invalidate();

If layout only contain one imageView, draw very smooth. But I add 2 3 or more than the view (button, image background), action_Move get event slowly and draw not smooth. Please help me!

2 Answers2

0

please refer to how to have smooth and quick drawing in a fingerPaing or use draw circle to fill the begin and end, also file the gap betwee two lines

Community
  • 1
  • 1
zjywill
  • 1,458
  • 2
  • 10
  • 14
0

Use getRawX() and getRawY() instead of getX() and getY()

Konstantin Konopko
  • 5,229
  • 4
  • 36
  • 62