As you can see when i use canvas.drawpath()
in my application i dont get the results that one user would want to.
See where my finger is and where it draws!
//Bitmap is the picture
imageview.setImageBitmap(bitmap);
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
paint.setColor(Color.Black);
paint.setStrokeWidth(50);
paint.setStyle(Paint.Style.STROKE);
path = new Path();
imageview.setOnTouchListener(this);
And here onTouchListener
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
path.moveTo(event.getX(), event.getY());
path.lineTo(event.getX(), event.getY());
canvas.drawPath(path, paint);
imageview.invalidate();
break;
case MotionEvent.ACTION_MOVE:
path.lineTo(event.getX(), event.getY());
canvas.drawPath(path, paint);
imageview.invalidate();
break;
case MotionEvent.ACTION_UP:
path.lineTo(event.getX(), event.getY());
canvas.drawPath(path, paint);
imageview.invalidate();
break;
case MotionEvent.ACTION_CANCEL:
break;
default:
break;
}
return true;
}