0

我目前正在尝试使用 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

至此指标完成。但是,我还没有任何可能降低指标的长度。我可以使用其他坐标重新绘制指标,但这会有点复杂(想想圆形部分)。我也不能用白色覆盖它,因为由于背景图像它必须是透明的。

有谁知道如何实现我想要的?或者指出我另一个可能的解决方案?

最好的问候,乔纳斯

4

1 回答 1

0

I dunno if I'm understanding what you want, but this is what I'd try

  1. Split it up into 3 columns, with a path in each column. The 1st column is has the path for the left edge.. the middle column will just have the top/bottom and will stretch, the right column will contain the right curves/etc.
  2. Create a rectangle with a radius the same as your inner corners and put it in the 2nd columns.
  3. visualize progress by updating the width of the rectangle.

This approach would only fill the progress up the "neck" of the bottle-like indicator you made.

于 2010-08-31T18:38:50.947 回答