sissonb
sissonb

Reputation: 3780

Capturing Signature in Vector Format on Android 2.x

I am writing an app that needs to capture a users signature in a vector format. On iOS I am using an SVG element to draw to then converting that SVG vector into the vector format I need. Now I need to do this in Android 2.x. The issue with this is that Android only supports the canvas for drawing.

Is there anyway to trace the user drawing on the canvas so that I get a vector format? Since the canvas creates a raster image I can't convert it to a vector.

Any ideas would be helpful.

Thanks

Upvotes: 1

Views: 921

Answers (1)

user931366
user931366

Reputation: 694

I don't believe this is supported directly. I think your best bet is to subclass android.graphics.Path and override moveTo(int, int) and lineTo(int, int), after storing these events you could then create a toSvgPathString() and get the "M x,y L x,y x,y x,y .." string you need.

Upvotes: 2

Related Questions