拖动在画布上绘制的形状与绘制相同 [英] To drag shapes drawn on canvas same as paint
问题描述
我有类似于paint的工具,我允许用户使用鼠标事件在画布上绘制不同的形状。我希望允许用户在画布上绘制后拖动形状(与绘画相同)。以前有人这样做过吗?我已经尝试过使用OOPDragging,但这在我的情况下不起作用。我的工具还包括各种形状,如Line,elbow connector,oval,text,image,而不仅仅是圆形和矩形。任何人都可以建议一些容易实现的解决方案,因为我需要尽快。
提前谢谢。
使用 www.Kineticjs.com 。
尝试以下链接 -
使用面向对象编程的简单HTML5 Canvas拖动示例 [ ^ ]
在HTML5画布上制作和移动可选形状:一个简单示例 [ ^ ]
HTML5 Canvas使用KineticJS将形状移动到另一个容器 [ ^ ]
I have tool similar to paint where i allow user to draw different shapes on canvas using mouse events.I want to allow the user to drag the shapes(same as paint) once they are drawn on canvas. Did anyone done like this before? I have already tried using OOPDragging but that didn't work in my case.Also my tool include all kind of shapes like Line,elbow connector,oval,text,image and not just circles and rectangles. Can anyone please suggest some easy to achieve solution for this as i need it ASAP.
Thanks in advance.
Use www.Kineticjs.com.
Try the following links -
A simple HTML5 Canvas dragging example using object oriented programming[^]
Making and Moving Selectable Shapes on an HTML5 Canvas: A Simple Example[^]
HTML5 Canvas Move Shape to Another Container with KineticJS[^]
这篇关于拖动在画布上绘制的形状与绘制相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!