Feeds

Get started with Silverlight

A time to shine

Beginner's guide to SSL certificates

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.

Security for virtualized datacentres

Next page: Going with the flow

More from The Register

next story
'Windows 9' LEAK: Microsoft's playing catchup with Linux
Multiple desktops and live tiles in restored Start button star in new vids
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
iOS 8 release: WebGL now runs everywhere. Hurrah for 3D graphics!
HTML 5's pretty neat ... when your browser supports it
Mathematica hits the Web
Wolfram embraces the cloud, promies private cloud cut of its number-cruncher
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
SUSE Linux owner Attachmate gobbled by Micro Focus for $2.3bn
Merger will lead to mainframe and COBOL powerhouse
iOS 8 Healthkit gets a bug SO Apple KILLS it. That's real healthcare!
Not fit for purpose on day of launch, says Cupertino
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
WIN a very cool portable ZX Spectrum
Win a one-off portable Spectrum built by legendary hardware hacker Ben Heck
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Security and trust: The backbone of doing business over the internet
Explores the current state of website security and the contributions Symantec is making to help organizations protect critical data and build trust with customers.