0

Say I draw something and I have a button to clear , how do i clean/clear/reset the drawing on the control ?

pnuts
  • 58,317
  • 11
  • 87
  • 139
abmv
  • 7,042
  • 17
  • 62
  • 100

2 Answers2

4

Well so far as I found out say I have a button to clear I just need to

inkPicture1.InkEnabled = false;
inkPicture1.Ink = new Microsoft.Ink.Ink();
inkPicture1.InkEnabled = true;
inkPicture1.Invalidate();

so that the control gets instantiated with a new ink object.

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
abmv
  • 7,042
  • 17
  • 62
  • 100
3

MSDN Reference: http://msdn.microsoft.com/en-us/library/ms701123%28v=vs.85%29.aspx

Get a refrence to the Ink Display object from the InckPicture's Ink property.

Then use the InkDisp.DeleteStrokes() method and pass InkDisp.Strokes property as Parameter.

Example:

            control.Enabled = false;
            control.Ink.DeleteStrokes();
            control.Enabled = true;
Jess
  • 23,901
  • 21
  • 124
  • 145
Shekhar_Pro
  • 18,056
  • 9
  • 55
  • 79