How do I delete or erase the last ink stroke entered onto a Freeform or ImageAnnotation field?

The attached example form demonstrates the ability to selectively set an ink stroke as deleted so that it does not render onto the Freeform or ImageAnnotation field. This offers greater flexibility as the usual API methods for erasing ink will remove all ink strokes from a field. The attached example contains both JavaScript and .NET methods where the Freeform or ImageAnnotation field is passed in and the method will find the last non-deleted ink stroke and delete it.