Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. Media Element on a Transparent Window...

Media Element on a Transparent Window...

Scheduled Pinned Locked Moved WCF and WF
question
10 Posts 2 Posters 18 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Edmundisme
    wrote on last edited by
    #1

    Hello, I have a media element playing a video. When I try to make the window transparent (by setting the AllowsTransparency property of the System.Windows.Window class to 'true') the application begins to run very slowly and the media element no longer plays the video correctly (the media element looks like a flickery green rectangle). I imagine what I want to do is possible, but I'm going about it the wrong way. For reasons that are unimportant to this post, I want the media element to look like it is free-floating and moving about the screen (when in actuality it would be moving about a transparent containing window). How do I create a completely transparent window that contains a media element (where the media element is playing a video)? Again, I want it to look to the user as though the video is not in a window, but right on the desktop. Thanks! Ian

    L 1 Reply Last reply
    0
    • E Edmundisme

      Hello, I have a media element playing a video. When I try to make the window transparent (by setting the AllowsTransparency property of the System.Windows.Window class to 'true') the application begins to run very slowly and the media element no longer plays the video correctly (the media element looks like a flickery green rectangle). I imagine what I want to do is possible, but I'm going about it the wrong way. For reasons that are unimportant to this post, I want the media element to look like it is free-floating and moving about the screen (when in actuality it would be moving about a transparent containing window). How do I create a completely transparent window that contains a media element (where the media element is playing a video)? Again, I want it to look to the user as though the video is not in a window, but right on the desktop. Thanks! Ian

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Make the Window transparent. Paint the background black. Set the opacity to 0. Run and tell me what happens.

      Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

      Just a grain of sand on the worlds beaches.

      E 1 Reply Last reply
      0
      • L Lost User

        Make the Window transparent. Paint the background black. Set the opacity to 0. Run and tell me what happens.

        Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

        Just a grain of sand on the worlds beaches.

        E Offline
        E Offline
        Edmundisme
        wrote on last edited by
        #3

        Thanks for the reply. I don't know what you mean by: Make the Window Transparent Paint the background black. If I set the background as black, how can I make the window transparent? (BTW, when I set the opacity of the window to 0, the media element is no longer visible.)

        L 1 Reply Last reply
        0
        • E Edmundisme

          Thanks for the reply. I don't know what you mean by: Make the Window Transparent Paint the background black. If I set the background as black, how can I make the window transparent? (BTW, when I set the opacity of the window to 0, the media element is no longer visible.)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Post your XAML and I'll edit it for you.

          Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

          Just a grain of sand on the worlds beaches.

          E 1 Reply Last reply
          0
          • L Lost User

            Post your XAML and I'll edit it for you.

            Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

            Just a grain of sand on the worlds beaches.

            E Offline
            E Offline
            Edmundisme
            wrote on last edited by
            #5

            Title="Window1" Height="768" Width="1024" Background="Transparent" AllowsTransparency="False" WindowStyle="None" ResizeMode="NoResize" Opacity="1" Visibility="Collapsed"> <Grid Background="Transparent"> <MediaElement Canvas.Left="96" Canvas.Top="38" Height="262" Name="mediaElement1" Source="C:\Windows\Web\Windows DreamScene\vid8899.mpg" Width="560" /> </Grid> </Window>

            L 1 Reply Last reply
            0
            • E Edmundisme

              Title="Window1" Height="768" Width="1024" Background="Transparent" AllowsTransparency="False" WindowStyle="None" ResizeMode="NoResize" Opacity="1" Visibility="Collapsed"> <Grid Background="Transparent"> <MediaElement Canvas.Left="96" Canvas.Top="38" Height="262" Name="mediaElement1" Source="C:\Windows\Web\Windows DreamScene\vid8899.mpg" Width="560" /> </Grid> </Window>

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I just did this program and it works perfect.

              <Window x:Class="Window1"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              Title="Window1" Height="769" Width="1024"
              Background="Transparent" AllowsTransparency="True"
              WindowStyle="None" ResizeMode="NoResize">

              <Grid Background="Transparent">
              <MediaElement Source="MetadataFormGeneration.wmv" Height="1024" Width="768" />
              </Grid>

              </Window>

              Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

              Just a grain of sand on the worlds beaches.

              E 1 Reply Last reply
              0
              • L Lost User

                I just did this program and it works perfect.

                <Window x:Class="Window1"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                Title="Window1" Height="769" Width="1024"
                Background="Transparent" AllowsTransparency="True"
                WindowStyle="None" ResizeMode="NoResize">

                <Grid Background="Transparent">
                <MediaElement Source="MetadataFormGeneration.wmv" Height="1024" Width="768" />
                </Grid>

                </Window>

                Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

                Just a grain of sand on the worlds beaches.

                E Offline
                E Offline
                Edmundisme
                wrote on last edited by
                #7

                I think the difference is that your media element is larger than your window. I was trying to have a smaller video move around inside a larger, invisible window. (BTW, thanks for your efforts with this problem.) Ian

                L 1 Reply Last reply
                0
                • E Edmundisme

                  I think the difference is that your media element is larger than your window. I was trying to have a smaller video move around inside a larger, invisible window. (BTW, thanks for your efforts with this problem.) Ian

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  I just made the video 1/2 the size of the window without any problem. What type of computer do you have. I have heard that some people have issues with older systems.

                  Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

                  Just a grain of sand on the worlds beaches.

                  E 1 Reply Last reply
                  0
                  • L Lost User

                    I just made the video 1/2 the size of the window without any problem. What type of computer do you have. I have heard that some people have issues with older systems.

                    Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

                    Just a grain of sand on the worlds beaches.

                    E Offline
                    E Offline
                    Edmundisme
                    wrote on last edited by
                    #9

                    Brand new Dell Precision m6300 laptop. Maybe I'm just trying to do something that my system can't handle. But if this system can't handle it, I don't want to do it anyway. Thanks for your help. Ian

                    L 1 Reply Last reply
                    0
                    • E Edmundisme

                      Brand new Dell Precision m6300 laptop. Maybe I'm just trying to do something that my system can't handle. But if this system can't handle it, I don't want to do it anyway. Thanks for your help. Ian

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Did you try my exact code on your system (need to change the video source)? Did you get the same issue? What is your systems Windows Experience Index? What is your Graphics score? What is your Gaming graphics score?

                      Cheers, Karl » CodeProject 2008 MVP » Microsoft MVP - Client App Dev My Blog | Mole's Home Page | MVP Profile

                      Just a grain of sand on the worlds beaches.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups