在WPF中的路径上绘制足迹 [英] Painting a trail over a Path in WPF

查看:92
本文介绍了在WPF中的路径上绘制足迹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图像在由多条线段组成的复杂路径上移动。我想在路径上绘制图像,好像图像在路径上留下蜗牛足迹一样,我是否可以这样做?我看过类似例子的多个例子,但是还没有合适的例子。谢谢
包含示例图像:

I have a image moving around a complex path made up with multiple line segments. I want to draw over the path as if the image is leaving a 'snail trail' over the path, is there anyway I can do this ? I have looked at multiple examples of similar things but nothing is suitable yet. Thanks Image included as example :

推荐答案

您可以使用路径动画 MatrixTransform 来实现此动作。然后,根据复杂路径的内容,您可能会在同一动画路径上使用其他alpha值使用多个其他 StoryBoard ,从而产生拖尾效果。

You can use Path Animations with MatrixTransform to achieve this motion. Depending on the content of your "Complex Path" you might then have multiple other StoryBoard's along the same animating path with different alpha values to thus give a trail effect.

也可以看看这个针对以上概念的 SO问题 应用于 Path

Also have a look over at this SO Question for the above concept applied to a Path

这篇关于在WPF中的路径上绘制足迹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆