签名板输出到数据URI方案(JSON到PHP)

时间:2013-08-17 18:27:16

标签: php javascript json html5 canvas

我目前正在使用Thomas J Bradley的Signature Pad,使用HTML5 Canvas在iPad上捕捉电子/数字签名。

链接:http://thomasjbradley.ca/lab/signature-pad/

捕获的输出是这样的:[{"lx":27,"ly":4,"mx":27,"my":3},{"lx":27,"ly":5,"mx":27,"my":4},{"lx":25,"ly":33,"mx":27,"my":5},{"lx":25,"ly":32,"mx":25,"my":33},{"lx":28,"ly":7,"mx":28,"my":6},{"lx":30,"ly":5,"mx":28,"my":7},{"lx":31,"ly":5,"mx":30,"my":5},{"lx":32,"ly":5,"mx":31,"my":5},{"lx":38,"ly":5,"mx":32,"my":5},{"lx":41,"ly":5,"mx":38,"my":5},{"lx":42,"ly":5,"mx":41,"my":5},{"lx":43,"ly":5,"mx":42,"my":5},{"lx":42,"ly":6,"mx":43,"my":5},{"lx":40,"ly":7,"mx":42,"my":6},{"lx":37,"ly":8,"mx":40,"my":7},{"lx":29,"ly":13,"mx":37,"my":8},{"lx":25,"ly":16,"mx":29,"my":13},{"lx":26,"ly":16,"mx":25,"my":16},{"lx":30,"ly":16,"mx":26,"my":16},{"lx":31,"ly":16,"mx":30,"my":16},{"lx":32,"ly":16,"mx":31,"my":16},{"lx":33,"ly":16,"mx":32,"my":16},{"lx":34,"ly":16,"mx":33,"my":16},{"lx":36,"ly":16,"mx":34,"my":16},{"lx":32,"ly":18,"mx":36,"my":16},{"lx":30,"ly":18,"mx":32,"my":18},{"lx":28,"ly":20,"mx":30,"my":18},{"lx":27,"ly":20,"mx":28,"my":20},{"lx":27,"ly":22,"mx":27,"my":20},{"lx":29,"ly":22,"mx":27,"my":22},{"lx":30,"ly":22,"mx":29,"my":22},{"lx":32,"ly":22,"mx":30,"my":22},{"lx":35,"ly":22,"mx":32,"my":22},{"lx":61,"ly":9,"mx":61,"my":8},{"lx":60,"ly":8,"mx":61,"my":9},{"lx":59,"ly":8,"mx":60,"my":8},{"lx":58,"ly":8,"mx":59,"my":8},{"lx":54,"ly":11,"mx":58,"my":8},{"lx":52,"ly":12,"mx":54,"my":11},{"lx":51,"ly":14,"mx":52,"my":12},{"lx":51,"ly":15,"mx":51,"my":14},{"lx":50,"ly":18,"mx":51,"my":15},{"lx":49,"ly":24,"mx":50,"my":18},{"lx":49,"ly":25,"mx":49,"my":24},{"lx":50,"ly":26,"mx":49,"my":25},{"lx":52,"ly":27,"mx":50,"my":26},{"lx":55,"ly":28,"mx":52,"my":27},{"lx":56,"ly":28,"mx":55,"my":28},{"lx":57,"ly":29,"mx":56,"my":28},{"lx":59,"ly":29,"mx":57,"my":29}]

我不确定是什么格式,但我认为它们是用于将电子/数字签名重新绘制到HTML5 Canvas上的JSON坐标。

这是我的问题:是否可以使用PHP将上面的输出转换为数据URI方案?

如果需要澄清,请告诉我。

1 个答案:

答案 0 :(得分:1)

我将JSON coords存储到一个数据库中,我能够在我的Javascript函数下抓取并回显它,并重新启动它。