WPF:创建动态进度指示器
我目前正在尝试使用 WPF 在 C# 中编写带有进度指示器的应用程序:
<Path Canvas.Left="15" Canvas.Top="50" Stroke="Red" StrokeThickness="6" Data=" M 700,100 L 620,100 C 620,100 600,100 600,80 L 600,50 C 600,50 600,30 580,30 L 50,30 L 50,340 L 580,340 C 580,340 600,340 600,320 L 600,290 C 600,290 600,270 620,270 L 700,270" Name="Progress" StrokeDashCap="Flat" StrokeEndLineCap="Round" StrokeLineJoin="Round" StrokeStartLineCap="Round" StrokeMiterLimit="30">
http://img839.imageshack.us/my.php?image=20100831180406。 png
至此指标就完成了。但是我还没有任何可能降低指示器的长度。我可以使用其他坐标重新绘制指示器,但这会有点复杂(考虑圆形部分)。另外,我无法用白色覆盖它,因为由于背景图像它必须是透明的。
有人知道如何实现我想要的吗?或者指出另一种可能的解决方案?
最好的问候, 乔纳斯
I'm currently trying to write an application with a progress indicator in C# using WPF:
<Path Canvas.Left="15" Canvas.Top="50" Stroke="Red" StrokeThickness="6" Data=" M 700,100 L 620,100 C 620,100 600,100 600,80 L 600,50 C 600,50 600,30 580,30 L 50,30 L 50,340 L 580,340 C 580,340 600,340 600,320 L 600,290 C 600,290 600,270 620,270 L 700,270" Name="Progress" StrokeDashCap="Flat" StrokeEndLineCap="Round" StrokeLineJoin="Round" StrokeStartLineCap="Round" StrokeMiterLimit="30">
http://img839.imageshack.us/my.php?image=20100831180406.png
So far the indicator is finished. However I don't have any possibility to lower the length of the indicator yet. I could redraw the indicator using other coordinates but that would be kind of complicated (think about the rounded parts). Also I can't overlay it with white color as it must be transparent due to a background image.
Does anyone have an idea on how to achieve what I want? Or point me to another possible solution?
Best greetings,
Jonas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道我是否理解你想要什么,但这就是我尝试
这种方法只会将进度填满您制作的瓶状指示器的“颈部”。
I dunno if I'm understanding what you want, but this is what I'd try
This approach would only fill the progress up the "neck" of the bottle-like indicator you made.