Sample code showing how to count mouse clicks when drawing ONE single line at a time. Now updated to draw vertical and horizontal lines. Also can split line into sections with a circle (filled or unfilled and select dots at ends) and adjust line widths. Can select the option of showing only 1 line or multiple lines (if unchecked). Also shows how to clear, load and save the picture. Lastly added some coordinates, so you can hover over an existing dot to get its coordinate. I made something quickly to show a perspective drawing.