Eraser method


Is there any sample that shows how I can erase specific character (or part of character) of smartstroke?

Do you mean erasing characters without using the Erase gestures?
You can find more details about 'scratch out' and 'strike through' Gestures in the documentation.

Hello Cate,

Yes, I mean the feature of eraser like android smart note app.

I know that already exist gesture for erase but I want more informations for eraser :)

Any idea?

The eraser feature is not available at the level of the ITC APIs today like the undo/redo feature. However it could be part of the next releases as well.
Anyway, if you want to invest some time to develop this feature, the following explanations may help:
To develop a simple eraser requires to detect intersection of an eraser stroke with the bounding rectangle of the character. Once done, you could define the remaining SmartWord resulting from the 'erase' action. Here is an example sequence:
1. Write hello
2. Do an erase stroke intersecting with the e of hello
3. Detect the intersection comparing the erase stroke coordinate with the bounding rectangle of a SmartWord and then with the bounding rectangle of its character(s).
4. Create the sub words corresponding to the erasure of the letter e of hello
4.1. Use createSubWord API from the WordFactory to create the word h with only one character in that case
4.2. Use createSubWord API from the WordFactory to create the word llo
4.3. Remove the word hello from the SmartPage using the removeWord API
4.4. Add the words h and llo to the SmartPage using the addWords API

Hope it could help. On our side we will update our documentation as soon as new features will be available.
Best regards.

Login or Signup to post a comment