0
행동 안에 애니메이션이 있지만 액체가 나오지 않습니다. 내가스토리 보드로 유체 애니메이션을 얻는 방법
int keyFrameCount = 360;
및
for (int i = 0; i < keyFrameCount; i++)
{
animation.KeyFrames.Add(new LinearDoubleKeyFrame(i, keyTime.FromTimeSpan(TimeSpan.FromSeconds(i * timeOffsetInSeconds))));
}
그것은 매우 부드러운 원을 회전합니다을 선택하면,
DoubleAnimationUsingKeyFrames animation = new DoubleAnimationUsingKeyFrames();
animation.SetValue(Storyboard.TargetPropertyProperty, new PropertyPath("(0).(1)", UIElement.RenderTransformProperty, RotateTransform.AngleProperty));
int keyFrameCount = 16;
double timeOffsetInSeconds = 0.1;
int targetValue = 12;
double totalAnimationLength = keyFrameCount * timeOffsetInSeconds;
double repeatInterval = RepeatInterval;
bool isShaking = IsShaking;
// Can't be less than zero and pointless to be less than total length
if (repeatInterval < totalAnimationLength)
repeatInterval = totalAnimationLength;
animation.Duration = new Duration(TimeSpan.FromSeconds(repeatInterval));
for (int i = 0; i < keyFrameCount; i++)
{
animation.KeyFrames.Add(new LinearDoubleKeyFrame(i % 2 == 0 ? targetValue : -targetValue, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(i * timeOffsetInSeconds))));
}
animation.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(totalAnimationLength))));
그러나 :
여기 내 애니메이션 코드입니다.
애니메이션을 0에서 30도, 다시 -30도, 으로 이동시킨 다음 다시 0으로 돌려 놓으면 (비트 주위에서 디더링) 애니메이션을 유창하게 보일 수 있습니다.
일부 시도 후, 나는 (정상적인) 앞뒤로 작동하지 않습니다, 그것은 완전히 제어 할 수없는 행동을 참조하십시오!
작품 완벽처럼 뭔가 애니메이션을 변경할 수 있습니다! 고마워요! –