08.01.2015 Views

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

Beginning Web Development, Silverlight, and ASP.NET AJAX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 16 ■ PROGRAMMING SILVERLIGHT WITH XAML AND JAVASCRIPT 385<br />

You can see the results of this in Figure 16-4.<br />

Figure 16-4. The different stretch modes for the ImageBrush<br />

The VideoBrush<br />

One of the more powerful features of <strong>Silverlight</strong> is its ability to paint a surface with video.<br />

This is achieved using the VideoBrush. You will use the VideoBrush in conjunction with<br />

the MediaElement control (which you will see later in this chapter).<br />

To use the VideoBrush, you add a MediaElement to your canvas, name it, <strong>and</strong> set it to<br />

be invisible <strong>and</strong> not accessible to the mouse. Then you simply set it to be the source for<br />

the VideoBrush.<br />

Here’s an example:<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!