It is also possible to apply a brush type HTML via HtmlBrush. The following is an example that can help you in understanding this :
Code:
< StackPanel x : Name = " LayoutRoot " Background = " White " >
< WebBrowser x : Name = " browser " Source = " youtube.html " Width = " 300 " Height = " 300 " Visibility = " Collapsed " / >
< Rectangle x : Name = " rect " Width = " 300 " Height = " 300 " >
< Rectangle . Fill > < HtmlBrush SourceName = " browser " / >
< / Rectangle . Fill > < / Rectangle > < / StackPanel >
The trick is that we cool our HtmlBrush via Redraw method.
Code:
void MainPage_Loaded ( object sender , RoutedEventArgs e)
{
DispatcherTimer timer = new DispatcherTimer () ;
timer.Interval = TimeSpan.FromMilliseconds ( 100 ) ;
timer.Tick + = new EventHandler (timer_Tick) ;
timer.Start () ;
}
void timer_Tick ( object sender , EventArgs e)
{
if (rect.Fill ! = null ) ((HtmlBrush)rect.Fill).Redraw () ;
}
Bookmarks