本文介绍了如何使用Raphael.JS根据鼠标移动绘制线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在纸上画一条线以及鼠标移动.我只知道如何使用path画一条线.但是想知道是否有人想与mousemove一起画一条线.请帮助我.

I am trying to draw a line along with mouse move on a paper. I just know how to draw a line using path. But wanted to know if anyone have ideas to make drawing a line along with mousemove. Please help me on this.

推荐答案

在此处使用拉斐尔(raphael)指向此类示例的链接

Here a link to such example using raphael

用Raphael绘图.效果如何...)

Drawing with Raphael.(Credit:Jonas). (click view->source to see how its done...)

和我以防万一的jsfiddle (just for back up)

它使用拖动 mousemove 拉斐尔在矩形元素上的事件...

It uses the drag and mousemove events of raphael over a rectangle element...

这篇关于如何使用Raphael.JS根据鼠标移动绘制线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:05