SIGN UP MEMBER LOGIN:    
ARTICLE

Tablet PC Ink Editing Modes - Select and Delete Ink

Posted by Mahesh Chand Articles | Metro Style Apps in C# June 25, 2004
In my previous articles, I discussed how to use Ink and set its properties to draw on a Windows Forms 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.
Reader Level:
Download Files:
 

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.

Login to add your contents and source code to this article
share this article :
post comment
 

I downloaded that source code but not including the deleting part please upload the deleting part also..............thanks

Posted by Prathiba Kaushalya Jun 14, 2011

please if its available apload the saving and retreive ink pictures to database.thanks amin.j

Posted by amin jalilzadeh Jan 11, 2011
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor