Mathieu Marques
Mathieu Marques

Reputation: 1748

Drawing interactively onto a <div>

I am building a web application in which the user would be able to draw zones (polygons) onto a video. A solution I already implemented was to put a <div> on top of the video player, catching the mouse clicks.

What I'm willing to do right now, is being able to draw on that <div> with the mouse:

I am looking for directions about which library to use. Already heard about:


Problem

Raphael looks monstruous but kinda overkill for what I want to do. And on the contrary, jsDraw2D seems to work just fine from what I tested (only drawed manually though).

I have several constraints such as:


Question

What should I use ? Should I stick to Raphael even though it's a bit difficult to implement (I've basically no background in JavaScript) ? Or do you know of a JavaScript library which could do what jsDraw2D does but in better ?

Thanks,

Upvotes: 0

Views: 351

Answers (2)

akash4eva
akash4eva

Reputation: 861

You should use SVG because they are obviously more interactive and easy to implement. If you've ever used Khanacademy then probably you'll come to know that they use SVG in their scratchpad.

Moreover, SVGs are also w3c recommended like canvas.

Upvotes: 1

Joe Ratzer
Joe Ratzer

Reputation: 18549

If you are able to go for HTML5 Canvas could be a good choice.

Upvotes: 0

Related Questions