i am using finger paint to draw line,and So far I have come up with the following code:
case MotionEvent.ACTION_MOVE:
//return if touch is in this area of canvas
if (x<=430 || y<=80 || y>=490) return true;
//draw path using x and y co-ordinates
mPath.quadTo(previousPoint.x, previousPoint.y, (x+previousPoint.x)/2,(y+previousPoint.y)/2);
canvas.drawPath(mPath, paint);
previousPoint.x = x;
previousPoint.y = y;
//invalidate canvas on move
imageView.invalidate();
break;
case MotionEvent.ACTION_UP:
Xend=x;
Yend=y;
//validate that is it true?
if((Xstart>=780 && Xstart<=830) && (Xend>=780 && Xend<=830) && (Ystart>=10 && Ystart<=200) && Yend<=800 && Yend>=300){
//show toast if correct
Toast.makeText(getBaseContext(), "Correct", Toast.LENGTH_SHORT).show();
}else{
//show toast with XY co-ordinates that your attempt is wrong
Toast.makeText(getBaseContext(), "Wrong attempt\n Xstart: "+Xstart+"\n Xend:"+Xend+"\n Ystart: "+Ystart+"\nYend:"+Yend, Toast.LENGTH_SHORT).show();
}
imageView.invalidate();
break;
But unfortunately, the above code does not fulfill my requirements. I want to create alphabetically organized worksheets, through which the user proceeds by touch. I'd like to know where he started, where he is moving to and where he ended to recognize what he drawn on canvas, i know where to get touch points but the problem is how to recognise what has been drawn on canvas? wants to recognize like this VisionObjects app on playstore.