2012-08-03 6 views
0

프로그래밍 방식으로 내 캔버스에 배치되는 이미지 컨트롤을 애니메이션화하기 위해 스토리 보드를 만들었습니다. 스토리 보드는 Expression Blend에서 만들어졌습니다.Storyboard WP7 - 좌표

스토리 보드를 재생할 때 이미지가 사라지고 다른 어딘가에서 움직입니다 (결국 이미지 컨트롤이 끝까지 보입니다). 처음에 이미지를 배치 한 곳에서는 움직이지 않습니다. 스토리 보드는 작동하지만 애니메이션을 원하는 위치에서 움직이지는 않습니다. 컨트롤은 화면 하단과 특정 이미지의 오른쪽에서 오른쪽으로 움직이는 것으로 가정합니다. 그래서 코드를 통해 이미지의 위치를 ​​변경합니다.

<Storyboard x:Name="sbBagExit"> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.SkewX)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="11"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="10.9973"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0" Value="332"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="332"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="332"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0" Value="-16"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="169.983"/> 
     </DoubleAnimationUsingKeyFrames> 
    </Storyboard> 
    <Storyboard x:Name="sbBagDrop"> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0" Value="0"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0" Value="-172"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="332.001"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="344"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="332"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0" Value="-8"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="-8"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-8"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.829"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="imgBag"> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1.2"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="1"/> 
     </DoubleAnimationUsingKeyFrames> 
    </Storyboard> 

번째 스토리 바로 첫 번째 후 발생 : 여기

는 XML이다.

나는 이것을 2 주 동안 계속해서 긁어왔다. 내가 할 수없는 것을 누군가 볼 수 있을까?

대단히 감사합니다.

답변

0

Blend를 사용하여 애니메이션을 생성 했으므로 Blend는 Blend에서 사용한 요소의 좌표 및 배치에 From 및 To 속성 값을 기반으로합니다.

해당 컨테이너와 여백을 포함합니다.

필요한 좌표를 지정하지 않았기 때문에 잘못된 점을 말할 수 없습니다.

TranslateX와 TranslateY를 변경하여 그들이하는 일과 내가 원하는 것을 할 때 알아 보겠습니다.

+0

이 오류가 발생하지 않도록 Expression Blend에서 어떻게 만들 수 있습니까? – Subby

+0

컨테이너와 요소를 적용 할 요소와 정확하게 일치하도록 만듭니다. 상대 좌표 만 사용하는 것이 좋으므로 By 속성 또는 To 속성 (From 속성을 지정하지 않고)이 설정됩니다. 이것은 그 이상한 300 번호를 방지합니다. –