Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs a method to restore a signature #11

Open
jdmuys opened this issue Jul 25, 2014 · 2 comments
Open

Needs a method to restore a signature #11

jdmuys opened this issue Jul 25, 2014 · 2 comments

Comments

@jdmuys
Copy link

jdmuys commented Jul 25, 2014

If you want to persist a signature across application launches, you need to save it first, using signatureImage. But you also need to restore a previously saved image back to the PPSSignatureView. Any idea how to do that?

@aschepis
Copy link

@jdmuys I don't think you'd want to do it that way. You want want to save/restore the raw data used to generate the image (such as the vertices and dots stored in the PPSSignatureView.) Unfortunately, at the present time the code doesn't store enough historical state as the user is signing to rebuild it. Things like pen thickness are not saved per sample.

It wouldn't be incredibly hard to add this sort of saving. The first way that comes to mind would be to simply keep an array of state objects/structs for each sample that is taken. Then you would want to refactor the tap and pan methods so that they were much simpler and just built one of these events, appended it to the array and then called another method with the smarts (you could call them onDot and onDraw for instance.) This would allow you to replay a signature by iterating the array of saved samples and calling those functions.

@Swinny1989
Copy link

Have you done anything to implement this functionality? It's something that I really need to use in my current project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants