Creating A Transparent Control To Overlay Windows Media Player
Posted on 2004-03-22
I am in the process of trying to overlay a control (any that will support transparency i would think should work) over the top of the Windows Media Player 9 ActiveX
control (currently contained in a Windows Form). What I cant seem to be able to do is to be able to get any type of control to show transparently over the top of the MediaPlayer control.
++ Basically what I want is the type of effect you see on tv every day where text is dispayed transparently over the video content that you are watching. Preferably I would like to see a method that would also enable to me to display images transparently over Media Player. One possible way may be overrideing the onPaint() method of a label and displaying a gdi+ pregenerated bitmap containing the text.
Please note also that this is a C# project so I would highly prefer answers in C# although I would also be willing to accept answers in VB.Net if you are not familiar with c# syntax. This is also a Windows Form project so please no Web Form related answers (ie web page embedding).
Heres what i have already tried (all involve hosting the ActiveX control in a windows form)
MediaPlayer.windowlessVideo = true; //also tried false
MediaPlayer.Controls.Add(myLabel); //where mylabel is a label with backcolor set to System.Color.FromArgb(125,Color.white)
this doesnt give the desired effect and i cant see the video playing underneath myLabel as i would expect from setting the backcolor to a transparent color
I then tried just adding myLabel to the same container form of the MediaPlayer control
this gives the same undesired effect.
I then tried having 2 separate forms. One to house the media player control. and another to open on top of that form with its opacity set < 1 so that I would be
able to see MediaPlayer underneath.
This also didnt give the desired effect. While the forms opacity was visually affected, it only affected the border of the windows form and you still couldnt see the Video underneath the form.