私はいくつかの WPF ダブル アニメーションを使用して移動しStackPanel
ます。
<Canvas ClipToBounds="True" Name="canMain" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<StackPanel Name="tbmarquee" HorizontalAlignment="Stretch" ></StackPanel>
</Canvas>
同じ時間に 30 秒使用するたびに、UIElemnts
アンダーの量が異なりStackPanel
ます。そのため、幅StackPanel
が異なり、アニメーションの速度が変化します。たとえば、下にたくさんのアイテムがある場合StackPanel
、アニメーションは非常に遅く、アイテムが1つある場合は非常に高速です。
安定したアニメーション速度を得るために使用しなければならない係数の手がかりはありますか?
ありがとうございました!
PS
このコードは多かれ少なかれ正しい係数を与えるようです
var coeff = 0;
if (test.Count >= 1 && test.Count <= 10)
coeff = 60;
else if (test.Count > 10 && test.Count <= 20)
coeff = 120;
else if (test.Count > 20 && test.Count <= 30)
coeff = 240;
else if (test.Count > 30 && test.Count <= 40)
coeff = 300;
else if (test.Count > 40 && test.Count <= 50)
coeff = 350;
else if (test.Count > 50 && test.Count <= 60)
coeff = 400;
else if (test.Count > 60 && test.Count <= 70)
coeff = 450;
else if (test.Count > 70 && test.Count <= 80)
coeff = 500;
else if (test.Count > 80 && test.Count <= 90)
coeff = 530;
else if (test.Count > 90 && test.Count <= 100)
coeff = 560;
and etc...
それを何らかの式に変換する方法の手がかりはありますか?