Kandy7
Kandy7

Reputation: 95

draw rectangle shape for drag and drop of a image to html5 canvas

i want to draw a shape ( lets say rectangle) if i drag a image that named as rectangle. if it is a circle image then drawn image should be a circle. How can i achieve this......?

Upvotes: 0

Views: 1626

Answers (1)

jing3142
jing3142

Reputation: 1871

Not sure if this helps but I have a project where if you click on an image of a rectangle you can then draw a rectangle, click on an ellipse then you can draw an ellipse. My shapes are stored as objects which are then drawn using Canvas.

My project is at http://canvimation.github.com/

The source code for my project is at https://github.com/canvimation/canvimation.github.com

The master branch is the current working code. You are welcome to use any of the code or fork the project.

Upvotes: 3

Related Questions