On Wed, Dec 29, 2010 at 10:18 PM, Paul <[email protected]> wrote: > Bumping hoping someone can point me in the right direction! > > Paul > > On Dec 29, 1:18 am, Paul <[email protected]> wrote: >> Hi all. I am writing an app that will convert touchscreen user inputs >> (such as the user 'handwriting' on the screen) into vectors that can >> then be saved and recalled later. I need to get the vectors into a >> format I can store locally, either as a file or in an SQLite >> database. Just wondering if anyone had any pointers as to how to get >> started... my initial thought was to listen for MotionEvents and when >> an ACTION_DOWN is detected, record the coordinates and use this as the >> vector's start point, and then record intermediate coordinates as the >> ACTION_MOVE is triggered (used to help define the shape of this Path >> they are creating), ending the stroke vector on ACTION_UP... but this >> results in many many intermediate points per vector (30 or 40) and >> with several hundred vectors (a full page of handwritten text on a >> tablet for example) this solution gets quickly out of hand as each >> page will potentially require tens of thousands of points... >> >> Any suggestions on a better way to represent and store user-inputed >> vectors/paths? Or maybe another approach completely? >> >> Thanks for any help! >> >> Paul >
Paul, You could blindingly start filtering any intermediate vectors, but you would miss some important points, where the writing drastically changes its direction. As you see, the problem you have is detecting where the continuous line changes its direction by much and intermediate points could be filtered. You would need calculating the angles between adjacent vectors and when the angle gets bigger than some threshold value, the point between said vectors becomes very important. Hope this helps you somehow. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

