Click here to Skip to main content
13,146,942 members (66,478 online)
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 27 Jun 2013

Video Brush in WPF

, 27 Jun 2013
Rate this:
Please Sign up or sign in to vote.
This tip explains how to use video brush and visual property as a media element.


A VisualBrush is used to fill UI elements. The following code uses a VisualBrush to fill a rectangle. We can define a simple or complex UI element and assign it to the VisualBrush.Visual property using VisualBrush. We can then use the VisualBrush to create interesting effects, such as reflection and magnification.  

How to Use

This example shows how to use the VisualBrush class with a Visual. Here, I am using media element as visual. A Visual object usually hosts one container panel such as a Grid or StackPanel and on this container.

Here is the XAML code:

<Window x:Class="WpfApplication4.MainWindow"
        Title="MainWindow" Height="350" Width="525">

        <Ellipse Height="100" Width="100" Name="elipsemedia" >
                <VisualBrush TileMode="None">
                        <MediaElement Source=
			"D:\TestingDB\wpftheme\wpftheme\Image\Wildlife.wmv" />


Here, I used Ellipse.fill property for video brush. This fill property  sets the Brush that specifies how the shape's interior is painted.


  • 27th June, 2013: Initial post

This tip is based on


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

India India
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
webmaster44228-Jun-13 6:14
memberwebmaster44228-Jun-13 6:14 
Questionreference Pin
josh-jw27-Jun-13 20:05
memberjosh-jw27-Jun-13 20:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 28 Jun 2013
Article Copyright 2013 by josh-jw
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid