Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Application Crashes when using more rectangle filling visual brush

$
0
0

Hi

i am creating a video player where i need to use nearly 50 rectangle to display the same video

using visual brush. issue is it is playing some times without crashing most of the time application crashes and shows

fault module  wpfgfx_v0400.dll and there is a fall in frame rate in filled rectangles.

thank you.

Code

    string SourceFile;
    MediaElement Element = new MediaElement();
    public void mediaaaaa( string PathFile)
    {

        SourceFile = PathFile;

        Element.LoadedBehavior = MediaState.Play;

        Element.BeginInit();


        Element.Source = new Uri(PathFile, UriKind.RelativeOrAbsolute);
        Element.EndInit();
        Element.UnloadedBehavior = MediaState.Close;


        StackPanel dd = new StackPanel();
        dd.Children.Add(Element);

        Element.MediaEnded += new RoutedEventHandler(Element_MediaEnded);

        WrapPanel wrap = new WrapPanel();

        foreach (MediaElement item in dd.Children)
        {
            for (int i = 0; i < 50; i++)
            {
RectangleVis=newRectangle();Vis.Fill=newVisualBrush(item);Vis.Width=200;Vis.Height=200;
                wrap.Children.Add(Vis);
} } canvas.Children.Clear(); canvas.Children.Add(wrap); } void Element_MediaEnded(object sender, RoutedEventArgs e) { Element.Source = new Uri(SourceFile); }



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>