-1

想知道我需要用下面的这些数据做什么?

我不知道该怎么办...

从此表单中获取签名后

     <form method="post" action="signed.cfm">

     <div class="sigPad" id="smoothed" style="width:404px;">
     <h2>Bezier Curves (constant pen width)</h2>
     <ul class="sigNav">
     <li class="drawIt"><a href="#draw-it" >SIGN</a></li>
     <li class="clearButton"><a href="#clear">Clear</a></li>
     </ul>
     <div class="sig sigWrapper" style="height:auto;">
     <div class="typed"></div>
     <canvas class="pad" width="400" height="250"></canvas>
     <input type="hidden" name="sigstr" class="output">
     </div>
     </div>

     <button type="submit">Sign</button> 
     </form>

签名完成 - 这是返回的内容......

[{"lx":123,"ly":99,"mx":123,"my":98},{"lx":123,"ly":98,"mx":123,"my": 99},{"lx":123,"ly":99,"mx":123,"my":98},{"lx":123,"ly":100,"mx":123,"my ":99},{"lx":123,"ly":103,"mx":123,"my":100},{"lx":124,"ly":105,"mx":123, "my":103},{"lx":124,"ly":107,"mx":124,"my":105},{"lx":126,"ly":109,"mx": 124,"my":107},{"lx":128,"ly":112,"mx":126,"my":109},{"lx":131,"ly":115,"mx ":128,"my":112},{"lx":133,"ly":117,"mx":131,"my":115},{"lx":136,"ly":120,"mx":133,"my":117},{"lx":139,"ly":123,"mx":136,"my":120}, {"lx":141,"ly":125,"mx":139,"my":123},{"lx":143,"ly":126,"mx":141,"my":125 },{"lx":146,"ly":128,"mx":143,"my":126},{"lx":149,"ly":131,"mx":146,"my" :128},{"lx":151,"ly":133,"mx":149,"my":131},{"lx":154,"ly":134,"mx":151,"我的":133},{"lx":157,"ly":136,"mx":154,"my":134},{"lx":159,"ly":137,"mx":157 ,"my":136},{"lx":161,"ly":138,"mx":159,"my":137},{"lx":162,"ly":140,"mx":161,"my":138},{"lx":164,"ly":141,"mx":162,"my":140}, {"lx":165,"ly":144,"mx":164,"my":141},{"lx":166,"ly":145,"mx":165,"my":144 },{"lx":167,"ly":146,"mx":166,"my":145},{"lx":168,"ly":147,"mx":167,"my" :146},{"lx":168,"ly":148,"mx":168,"my":147},{"lx":167,"ly":148,"mx":168,"我的":148},{"lx":166,"ly":148,"mx":167,"my":148},{"lx":165,"ly":148,"mx":166 ,"my":148},{"lx":164,"ly":147,"mx":165,"my":148},{"lx":163,"ly":147,"mx":164,"my":147},{"lx":163,"ly":144,"mx":163,"my":147}, {"lx":163,"ly":141,"mx":163,"my":144},{"lx":168,"ly":134,"mx":163,"my":141 },{"lx":175,"ly":124,"mx":168,"my":134},{"lx":185,"ly":115,"mx":175,"my" :124},{"lx":197,"ly":105,"mx":185,"my":115}]175,"ly":124,"mx":168,"my":134},{"lx":185,"ly":115,"mx":175,"my":124},{"lx ":197,"ly":105,"mx":185,"my":115}]175,"ly":124,"mx":168,"my":134},{"lx":185,"ly":115,"mx":175,"my":124},{"lx ":197,"ly":105,"mx":185,"my":115}]

http://www.jqueryscript.net/demo/Smooth-Signature-Pad-Plugin-with-jQuery-Html5-Canvas/examples/

4

1 回答 1

0

我是将 JSON 转换为图像的 PHP 脚本的 ColdFusion-port 的作者。我们已经保存了 JSON 数据,以防我们需要即时生成签名。为了将其转换为图像,您需要将 JSON 数据返回到 CF 服务器并将其传递给 UDF。它将生成一个图像,然后您可以将其提供回浏览器或将其保存为物理图像文件。

如果您仍然遇到 UDF 的问题,请提供一些源代码来演示您如何使用它。

这是一种非常通用的使用方式。

将带有 JSON 数据的“SignatureJSON”参数发布到“/GenerateSig.cfm”。

<CFPARAM NAME="Form.SignatureJSON" DEFAULT="">
<CFIF NOT isJSON(Form.SignatureJSON)><CFABORT></CFIF>

<CFSET TheImage = sigJsonToImage(Signature_Pad_JSON_Data)>

<CFIF NOT IsImage(TheImage)>
    Invalid Image<CFABORT>
<CFELSE>
  <!--- Display Image inline --->
  <cfimage action = "writeToBrowser" source="#TheImage#">
  <!--- or save file and serve via IMG tag
     <cfset ImageWrite(TheImage, "c:\signature.png")> --->
</CFIF>
于 2016-07-11T18:27:11.843 回答