如何在InkCanvas UWP中执行撤消和重做操作?

时间:2017-09-18 13:08:14

标签: uwp inkcanvas

我想在InkCanvas中执行撤消和重做操作。怎么做?

如何在PointerReleasing上获取笔画。我试过了代码

path = new InkCanvas()
        {
            Height = mImageEditor.imageEditorPanel.ActualHeight,
            Width = mImageEditor.imageEditorPanel.ActualWidth
        };
        CoreInkIndependentInputSource core = CoreInkIndependentInputSource.Create(path.InkPresenter);
        core.PointerReleasing += Core_PointerReleasing;

        path.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Mouse 
                                            | Windows.UI.Core.CoreInputDeviceTypes.Touch;
        InkDrawingAttributes inkDrawingAttributes = new InkDrawingAttributes();
        inkDrawingAttributes.Color = Windows.UI.Colors.Blue;
        inkDrawingAttributes.Size = new Size(8, 8);
        path.InkPresenter.UpdateDefaultDrawingAttributes(inkDrawingAttributes);
        var value = path.InkPresenter.StrokeContainer.GetStrokes();
        this.Children.Add(path);

我得到了这个例外,所以我无法在指针释放事件中获得笔画。 enter image description here

如何进行撤消和重做操作?任何人请建议我。

0 个答案:

没有答案