Draw shape with mousedown

I can’t figure it out by myself. I like to draw something like circle or line or curve with mouse down, like in paint program. also like to change the width of line.
like this
1087-Untitled-1.jpg

can anyone help me. Thanks in advance.

check this out