Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
media
danimation.controls
danimation.programming
devices
drm
dshow.programming
dtransform
encoder
encoder.optimization
hometheaterpc
media
media.beta
media.beta.encoder
mediacenter
mediacenter.portable
mediaplayer
music.products
musicproducer
player
player.plugins
player.skins
player.solaris
player.visualizations
player.web
sdk
server
tools
  
 
date: Wed, 20 Aug 2008 09:03:26 -0700 (PDT),    group: microsoft.public.windowsmedia.sdk        back       


windows media player as a background   
Hello,
Trying to do this in c# but not sure this can be achieved. What I want
is to have a windows media window as background, and have labels at
front.
However, the problem is that the label has background and it is not
transparent. So I put a transparent label in:
public class TransparentLabel : System.Windows.Forms.Label
	{
		  protected override CreateParams CreateParams
        {

            get
            {

                CreateParams cp = base.CreateParams;

                cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT

                return cp;

            }

        }
        protected void InvalidateEx()
        {

            if (Parent == null)

                return;

            Rectangle rc = new Rectangle(this.Location, this.Size);

            Parent.Invalidate(rc, true);

        }
        protected override void OnPaintBackground(PaintEventArgs
pevent)
        {

            //do not allow the background to be painted

        }

	}

The problem is that when I put this control on top of the media player
component, the label just dispears when the movie starts.

So is there some way to work it out?

Many Thanks

Jerry
date: Wed, 20 Aug 2008 09:03:26 -0700 (PDT)   author:   DAXU

Re: windows media player as a background   
Hello Jerry,

Did you try adding label on top of the WMP control and setting its backcolor 
to transparent [Web].and forecolor to white.

Regards
Sreejumon [MVP]


"DAXU"  wrote in message 
news:1910ca66-553b-4859-b342-5100394e3b3c@w7g2000hsa.googlegroups.com...
> Hello,
> Trying to do this in c# but not sure this can be achieved. What I want
> is to have a windows media window as background, and have labels at
> front.
> However, the problem is that the label has background and it is not
> transparent. So I put a transparent label in:
> public class TransparentLabel : System.Windows.Forms.Label
> {
>   protected override CreateParams CreateParams
>        {
>
>            get
>            {
>
>                CreateParams cp = base.CreateParams;
>
>                cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
>
>                return cp;
>
>            }
>
>        }
>        protected void InvalidateEx()
>        {
>
>            if (Parent == null)
>
>                return;
>
>            Rectangle rc = new Rectangle(this.Location, this.Size);
>
>            Parent.Invalidate(rc, true);
>
>        }
>        protected override void OnPaintBackground(PaintEventArgs
> pevent)
>        {
>
>            //do not allow the background to be painted
>
>        }
>
> }
>
> The problem is that when I put this control on top of the media player
> component, the label just dispears when the movie starts.
>
> So is there some way to work it out?
>
> Many Thanks
>
> Jerry
date: Thu, 21 Aug 2008 22:53:03 +0530   author:   Sreejumon [MVP]

Re: windows media player as a background   
From: "DAXU"

[...]
> The problem is that when I put this control on top of the
> media player component, the label just dispears when the
> movie starts.

I can not guarantee that the following will work, but you 
can try: set WMP as windowless then put all of your GUI 
elements into another window, make it transparent and put it 
on top of the WMP area.




-- 
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
date: Mon, 25 Aug 2008 11:41:34 -0400   author:   Alessandro Angeli

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us