A Meteor client code renders a template with canvas
for client signature. It listens on mousemove
and draws lines between mouse x,y coordinates of one point to another as it moves, using context.stroke()
.
Meteor客户端代码呈现带有画布的模板以进行客户端签名。它使用context.stroke()监听mousemove并在移动时在一个点的鼠标x,y坐标之间绘制线条。
How can the signature be saved and inserted in html page later? i.e. data or image would be best practice? Thanks
如何保存签名并在以后的html页面中插入?即数据或图像是最佳做法?谢谢
1 个解决方案
#1
0
Use a variable
使用变量
var image = ctx.getImageData(0,0,width,height);
To put it back when you need it:
在需要时把它放回去:
ctx.putImageData(imgdata, 0,0);
#1
0
Use a variable
使用变量
var image = ctx.getImageData(0,0,width,height);
To put it back when you need it:
在需要时把它放回去:
ctx.putImageData(imgdata, 0,0);