How to clear microsoft ink picture control?

ぃ、小莉子 提交于 2019-12-24 22:20:04

问题


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


回答1:


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.




回答2:


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;


来源:https://stackoverflow.com/questions/4447909/how-to-clear-microsoft-ink-picture-control

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!