I need to build a project for drawing on canvas by fingers,
to get the touch event and motion event of my finger, and thence draw.
Any one can advice me how to get start in project,
and what is best component to do thing like this?
I need to build a project for drawing on canvas by fingers,
to get the touch event and motion event of my finger, and thence draw.
Any one can advice me how to get start in project,
and what is best component to do thing like this?
tutorial to draw line use Bitmap, Canvas, and Paint class. draw-line-on-finger-touch and androiddraw
here one simple class to draw line using canvas as show below.
I think it's important to add a thing, if you use the layout inflation that constructor in the drawview is not correct, add these constructors in the class:
or the android system fails to inflate the layout file. I hope this could to help.
Regarding the beautiful code of Raghunandan above.
Many have asked how to "clear" the drawing. Here's how to do that:
Many have asked how to "save" the drawing. Here's how to do that:
Hope it helps someone as this has helped me.
You can use this class simply:
Start By going through the Fingerpaint demo in the sdk sample.
Another Sample:
Snap shot
Explanation :
You are creating a view class then extends View. You override the onDraw(). You add the path of where finger touches and moves. You override the onTouch() of this purpose. In your onDraw() you draw the paths using the paint of your choice. You should call invalidate() to refresh the view.
To choose options you can click menu and choose the options.
The below can be used as a reference. You can modify the below according to your needs.
Color Picker