VideoBrush Object

Paints an area with video content.

<VideoBrush .../>
To create an object using scripting, see the CreateFromXAML method.


AlignmentX, AlignmentY, Name, Opacity, RelativeTransform, SourceName, Stretch, Transform


Equals, FindName, GetHost, GetValue, SetValue


A detailed walkthrough of how to use a VideoBrush is documented in the Silverlight VideoBrush Overview.

A VideoBrush is a type of Brush object similar to a LinearGradientBrush or an ImageBrush. However, instead of painting an area with a solid color, a gradient, or an image, it paints an area with video content. This video content is provided by a MediaElement. Just like the other brush types, you can use a VideoBrush to paint the Fill of a shape such as a Rectangle or the geometry contents of a Path, the Background of a Canvas, or the Foreground of a TextBlock or Run.

To use a VideoBrush, you create a MediaElement, apply the VideoBrush to the object that you want to paint, and set the VideoBrush object's SourceName property to the Name of the MediaElement that you created.


The following example uses a VideoBrush to paint the Foreground of a TextBlock.

      Source="sampleMedia/Butterfly.wmv" IsMuted="True"
      Opacity="0.0" IsHitTestVisible="False" />
    <TextBlock Canvas.Left="5" Canvas.Top="30"  
      FontFamily="Verdana" FontSize="120" 
      FontWeight="Bold" TextWrapping="Wrap"
        <!-- Paint the text with video. -->
          <VideoBrush SourceName="butterflyMediaElement" Stretch="UniformToFill" />

For more information, see the VideoBrush Overview.

See Also

VideoBrush Overview
Brush Overview
Silverlight Objects