Open jdmuys opened 10 years ago
@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.
Have you done anything to implement this functionality? It's something that I really need to use in my current project
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?