Can we drag and drop Composite shapes from one canvas to another [closed]

懵懂的女人 提交于 2019-12-12 00:33:17

问题


I am new to HTML5, as I know only basics about this. If anyone could help me in this that would be great for me.

I need to design diff shapes and drag and drop from div to canvas. I created different shapes using globalcomposite operation in canvas, now I need to drag from canvas to another canvas.

I hope some one understood my point any help would be great. jsfiddle.net/rGUma/5/# some what like this,in place those three images i need to keep my design shapes is that possible.

That's not my jfiddle its an example,i want like that Thanks for ur response


回答1:


As soon as you draw an image to a canvas, it stops being a coherent image object and becomes a bunch of pixels in a graphic buffer. When you want to interact with these pixels, you need to do this programmatically. I think you won't get around implementing your own drag&drop functionality by catching mousedown, mousemove, mouseout, mouseover and mouseup events on both canvases and drawing the shape the users clicked on at their mouse cursor while they move the mouse.



来源:https://stackoverflow.com/questions/13873374/can-we-drag-and-drop-composite-shapes-from-one-canvas-to-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!