In Android XML is there a touch input?
Is it possible to create a touch draw area to take signatures in a form?
I am working on an application to collect information though a form and would like to col开发者_如何学编程lect signatures by letting users of the app draw a signature on the screen. How would I do this for android. Preferably I would like the "signature" stored as a image to save somewhere.
Does anyone have any idea?
Many thanks,
Check out Google's API example of Fingerpaint -- the full app is included in the samples -- but the code to the main Java file is here.
Basically, make some small section of the view a canvas control (like in finger paint) and then when the user presses done, save the Canvas
as an image (using the Bitmmap
object attached to the Canvas
.)
You may want to turn rotation off for this particular view, otherwise the signature will get cleared when you rotate the image -- unless you implement some way of rotating it.
精彩评论