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)
1)
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)
myLabel.bringtofront();
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
2)
I then tried just adding myLabel to the same container form of the MediaPlayer control
this gives the same undesired effect.
3)
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.
This does work sort of but it will hightlight what I've been saying:-
Set up your form 1 with the player on it have it playing movie.
Open another form 2 with its opacity set to 50% have form 1 open form 2.
as the video plays right click it select options, click advanced button and turn use "use overlays" off. OK
bring you form2 to the front and hover it over the player,, TA DA!!!!
but on my system it sometimes flickers, I suspect that this it the form2 trying desparatly to handle the onPaint event, so some otimisations will be required here.