O'Reilly logo

Instant Silverlight 5 Animation by Nick Polyak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Code description

The code for the demo is located under the AnimatedBanner project.

Referring to the globe image within an XAML file

As was previously mentioned, I downloaded the globe image from the Microsoft ClipArt website and added it to the project as a resource.

The following code will show you how to add the image to the MainPage.xaml file:

<Image x:Name="image"
        Source="Globe.png"
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Margin="0,0,10,0"
        Width="270">
    <Image.Projection>
        <!-- GlobalOffsetZ for a still image
                controls its Z-depth. I had to play
                with this parameter to create an 
                illusion of letters going behind 
                the Globe during the rotation-->
        <PlaneProjection GlobalOffsetZ="30" />
    </Image.Projection>
</Image>

Creating rotating lines ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required