嗨我正试图在导航到下一个屏幕时自动删除当前屏幕上绘制的草图。 xaml代码
public WorkBookP()
{
this.InitializeComponent();
ink.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch;
// Set initial ink stroke attributes.
InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
drawingAttributes.Color = Windows.UI.Colors.Black;
drawingAttributes.IgnorePressure = false;
drawingAttributes.FitToCurve = true;
ink.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
}
在此Nextbtntap上单击我希望当前屏幕上绘制的文本应自动删除
private void Nextbtntap(object sender, TappedRoutedEventArgs e)
{
ink.InkPresenter.InputProcessingConfiguration.Mode = InkInputProcessingMode.Inking;
currentIndex++;
if (currentIndex > 9)
{
currentIndex = 9;
return;
}
Digitcsimg.Source = new BitmapImage(new Uri("ms-appx:///Assets/Workbook/DigitArt/WS" + currentIndex + ".png"));
DispDigit.Text = DigCount[currentIndex];
}
任何帮助将不胜感激
答案 0 :(得分:0)
根据您的说明,您似乎想在点按按钮时清除InkCanvas
。如果是这样,您可以尝试使用InkStrokeContainer.Clear方法。
例如,您可以将以下代码添加到Nextbtntap
方法中,以删除名为" ink"的InkCanvas
中的所有油墨。
ink.InkPresenter.StrokeContainer.Clear();