Feeds

Get started with Silverlight

A time to shine

Choosing a cloud hosting partner with confidence

XAML and Microsoft

XAML first appeared with the Windows Presentation Foundation (WPF) to describe the various graphical and multimedia assets along with their placement, characteristics and behaviours. XAML decouples presentation information from application logic allowing files to be shared between developers and designers. XAML is at the heart of the fledgling Microsoft Expression tools for design and will be prevalent in the forthcoming Visual Studio 2008.

A XAML file typically starts with a canvas, onto which you can place various graphical objects. In the example above, we added a TextBlock, but we could have equally used a Rectangle, Ellipse, Polygon or any one of a number of predefined elements. The MediaElement even provides access to video playback.

Animations can be specified by creating a Storyboard and a number of event triggers. All this can be extended by developers using JavaScript code.

Adding video

Now that we have a basic framework in place, we can start to experiment and add features just by changing the scene.xaml file.

You can easily plug in your own video content – here I've just taken one of the videos that come with Windows, renamed it to MyVideo.wmv and copied it into the project directory.

You can reference the video with a MediaElement and then use it in a VideoBrush.

<Canvas xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        
        <MediaElement Name="Video" Source="MyVideo.wmv" Opacity="0"  />

        <TextBlock FontFamily="Times New Roman"
                           FontSize="70"
                           FontStyle="Italic"
                                FontWeight="Bold" 
                           Text="Hello World" >
                <TextBlock.Foreground>
                        <VideoBrush SourceName="Video" />
                </TextBlock.Foreground>
        </TextBlock>

</Canvas>


Now when you run the HTML the video content plays back, masked by the text.

Beginner's guide to SSL certificates

Next page: Going with the flow

More from The Register

next story
Be real, Apple: In-app goodie grab games AREN'T FREE – EU
Cupertino stands down after Euro legal threats
Download alert: Nearly ALL top 100 Android, iOS paid apps hacked
Attack of the Clones? Yeah, but much, much scarier – report
You stupid BRICK! PCs running Avast AV can't handle Windows fixes
Fix issued, fingers pointed, forums in flames
Microsoft: Your Linux Docker containers are now OURS to command
New tool lets admins wrangle Linux apps from Windows
Bada-Bing! Mozilla flips Firefox to YAHOO! for search
Microsoft system will be the default for browser in US until 2020
Facebook, working on Facebook at Work, works on Facebook. At Work
You don't want your cat or drunk pics at the office
Soz, web devs: Google snatches its Wallet off the table
Killing off web service in 3 months... but app-happy bonkers are fine
prev story

Whitepapers

Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
5 critical considerations for enterprise cloud backup
Key considerations when evaluating cloud backup solutions to ensure adequate protection security and availability of enterprise data.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Choosing a cloud hosting partner with confidence
Download Choosing a Cloud Hosting Provider with Confidence to learn more about cloud computing - the new opportunities and new security challenges.