Tablet PC Ink Editing Modes - Select and Delete Ink


In my previous articles, I discussed how to use to use Ink and set its properties to draw on a Windows Form and Windows controls. In this article, I will discuss some more features of Tablet PC ink including selecting and deleting ink, Ink collection, and Ink object.

The EditingMode

The EditingMode property of InkOverlay allows us to set the editing mode of ink overlay. There are three modes - Ink, Select, and Delete. The EditingMode is a type of InkOverlayEditingMode enumeration. By default, Ink is the editing mode for ink overlay.

The Application

Attached project is a Windows Forms application which allows you to set height, width, and pen color properties of Ink. The application also allows you to change the modes of ink.  Click Apply button to activate the ink.

The Select Ink check box changes the application from Ink mode to Select mode. Here is the check box click event handler. As you can see from the below code, when check box is checked, the editing mode is changing to Select, otherwise its change back to Ink.

private void SelectInkCheckBox_CheckedChanged(object sender, System.EventArgs e)
{
if(SelectInkCheckBox.Checked)
{
inkOverlay.Enabled = false;
inkOverlay.EditingMode = InkOverlayEditingMode.Select ;
inkOverlay.Handle = this.Handle;
inkOverlay.Enabled = true;
}
else
{
inkOverlay.Enabled = false;
inkOverlay.EditingMode = InkOverlayEditingMode.Ink;
inkOverlay.Handle = this.Handle;
inkOverlay.Enabled = true;
}
}

Delete Ink button click changes the editing mode to Delete. In this case the default cursor converts to a rubber stamp and you can rollover the ink and it will start erasing the ink. Below code is the Delete button click event handler:

private void DeleteBtn_Click(object sender, System.EventArgs e)
{
inkOverlay.Enabled = false;
inkOverlay.EditingMode = InkOverlayEditingMode.Delete;
inkOverlay.Handle = this.Handle;
inkOverlay.Enabled = true;
}

Ink collection and Ink object are two other topics left to be discussed related to ink functionality. In my forthcoming articles, I will cover these two topics.


Similar Articles
Mindcracker
Founded in 2003, Mindcracker is the authority in custom software development and innovation. We put best practices into action. We deliver solutions based on consumer and industry analysis.