简体   繁体   English

使用JSignature返回笔画

[英]Using JSignature to return strokes

I'm working on an Outsystems project, which is using a plugin built on JSignature. 我正在开发一个Outsystems项目,该项目正在使用基于JSignature构建的插件。 I was wondering if it was possible to use JSignature to return the strokes on the canvas, ie the x and y co-ordinates of the strokes made by the user. 我想知道是否可以使用JSignature返回画布上的笔触,即用户做出的笔触的x和y坐标。 If not, is there a way to convert an image in order to obtain the co-ordinates as they would be on a canvas? 如果没有,是否有一种方法可以转换图像以获得与画布上相同的坐标?

According to jSignature's documentation , the component supports exporting a signature in a native format, as arrays of (x,y) coordinates, or in SVG format, besides the image format that the OutSystems Forge component uses. 根据jSignature的文档 ,除OutSystems Forge组件使用的图像格式外,该组件还支持以本机格式(x,y坐标数组)或SVG格式导出签名。 The methods to do this are not part of the Signature Forge component, so you'll have call the necessary functions yourself. 执行此操作的方法不是Signature Forge组件的一部分,因此您将自己调用必要的函数。

If you open the Signature component's code you'll notice that this is how it is initialized: 如果打开签名组件的代码,则会注意到这是如何初始化的:

$(document).ready(function() {
     var " + Replace(jSignature.RuntimeId,":","") + "_signature = new Signature();
     " + Replace(jSignature.RuntimeId,":","") + "_signature.initUI('" + PlaceId + "', '" + ImageInputId + "', " + If(ShowClearLink, "true", "false") + "," + Settings + ");
     $('#" + PlaceId + "').addClass('NoSwipe');
});

This means the screen where the component is used in will have a variable (named using the expression "Replace(jSignature.RuntimeId,":","") + "_signature") that you can use to invoke the getData function and obtain the information you want. 这意味着使用组件的屏幕将具有一个变量(使用表达式“ Replace(jSignature.RuntimeId,“:”,“”)+“ _signature”命名),可用于调用getData函数并获取您想要的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM