开发者

How to make a image spin/rotate around the z axis

开发者 https://www.devze.com 2023-03-29 09:22 出处:网络
I would like to spin/rotate my Logo(Image) on the Z axis. This is the code i have so far: <Image Name=\"logo\"Grid.Row=\"1\" Grid.Column=\"0\" Source=\"someLogoPath\" Width=\"140\" Height=\"140\"

I would like to spin/rotate my Logo(Image) on the Z axis.

This is the code i have so far:

<Image Name="logo"  Grid.Row="1" Grid.Column="0" Source="someLogoPath" Width="140" Height="140" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,10,0,0">
        <Image.RenderTransform>
            <RotateTransform x:Name="TransRotate" />
        </Image.RenderTransform>
        <Image.Triggers>
            <EventTrigger RoutedEvent="Image.Loaded">
                <BeginStoryboard>
                    <Storyboard TargetProperty="Angle">
                        <DoubleAnimation
                         Storyboard.TargetName="TransRotate" 
                         Storyboard.TargetProperty="Angle"
                 开发者_StackOverflow        By="360" 
                         Duration="0:0:10"  
                         AutoReverse="False" 
                         RepeatBehavior="Forever" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Image.Triggers>
    </Image>

This only spins it on the X axis.

What do i need to do, to get it to spin on the Z axis?


Do you mean something like this?

<Image.RenderTransform>
    <RotateTransform x:Name="TransRotate" CenterX="70" CenterY="70" />
</Image.RenderTransform>

or

<Image Name="logo" RenderTransformOrigin="0.5,0.5" />
0

精彩评论

暂无评论...
验证码 换一张
取 消