WPF PathGeometry смещается в DoubleAnimationUsingPath

Так что я новичок в WPF и понятия не имею, почему это не работает. Я хочу сделать DoublePathAnimation на эллипсе. Поэтому я использовал PathObject, чтобы просто узнать, какие фигуры PathGeometry мне нужны.

<Path Stroke="Black" StrokeThickness="5">
    <Path.Data>
        <PathGeometry Figures="M 200,100 C 307,180 390, 180 500,190"></PathGeometry>
    </Path.Data>
 </Path>

Но теперь, когда я использую эти рисунки в моей PathAnimation, вот так:

<Storyboard>
    <!-- The X-axis animation -->
    <DoubleAnimationUsingPath Name="aniX21"
        Storyboard.TargetName="exportTarget21"
        Storyboard.TargetProperty="X"
        Source="X"
        Duration="0:0:03"
        RepeatBehavior="Forever"
        AutoReverse="False">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures="M 200,100 C 307,180 390, 180 500,190"/>
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>
    <DoubleAnimationUsingPath Name="aniY21"
        Storyboard.TargetName="exportTarget21"
        Storyboard.TargetProperty="Y"
        Source="Y"
        Duration="0:0:03"
        RepeatBehavior="Forever"
        AutoReverse="False">
        <DoubleAnimationUsingPath.PathGeometry>
            <PathGeometry Figures=" M 200,100 C 307,180 390, 180 500,190" />
        </DoubleAnimationUsingPath.PathGeometry>
    </DoubleAnimationUsingPath>

Анимация работает, но только x-координаты верны. Y-координаты полностью смещены.

0 ответов

Другие вопросы по тегам