有没有办法在InkCanvas上获得当前的Stroke?

时间:2017-10-05 10:01:55

标签: c# uwp inkcanvas

在UWP中,我使用InkCanvas来检测笔画。我想更改当前Stroke的颜色。 我尝试了几个事件,但我只能通过以下事件收集后更改Stroke的颜色:

InkCanvas.InkPresenter.StrokesCollected += InkPresenter_StrokesCollected

private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args)
{
    foreach (InkStroke stroke in InkCanvas.InkPresenter.StrokeContainer.GetStrokes())
    {
        InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
        drawingAttributes.Color = Windows.UI.Colors.Blue;
        stroke.DrawingAttributes = drawingAttributes;
    }
}

我也尝试了StrokeInput上的事件,但我无法通过这种方式找到当前的笔画。

0 个答案:

没有答案