Study this HTML5 example for image drawing.

I really think it is worth the trouble to use HTML5 as time-effective
and simple GUI front-end.