如果我理解正确的话,你可以简单地添加了黄色矩形额外的底层和在创建从顶层到其他层尽快将您的行程。
XAML:背后
<Grid>
<Canvas x:Name="canvas"/>
<InkPresenter x:Name="inkPresenter"/>
<InkCanvas x:Name="inkCanvas" StrokeCollected="InkCanvas_StrokeCollected" Background="Transparent"/>
</Grid>
代码:
void InkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e) {
var stroke = e.Stroke;
inkCanvas.Strokes.Remove(stroke);
inkPresenter.Strokes.Add(stroke);
var bounds = stroke.GetBounds();
var yellowRect = new Rectangle { Width = bounds.Width, Height = bounds.Height, Fill = Brushes.Yellow };
Canvas.SetLeft(yellowRect, bounds.X);
Canvas.SetTop(yellowRect, bounds.Y);
canvas.Children.Add(yellowRect);
}
也许你可以包括MCVE这里您将招InkCanvas(1)未经黄色矩形,以便其他人可以专注于自己的主问题? – grek40
@ grek40对不起...什么是MCVE? –
http://stackoverflow.com/help/mcve对不起,我假设你知道短。 – grek40