I am usi开发者_如何学编程ng Windows Media Player control in C# and I want a semi-transparent video at video play time. I set Opacity
to 0.5
in my form. It is semi-transparent in Windows 7
but it isn't translucent in Windows XP
. Please tell me the illustrates how it is done at Windows XP? I use the development environment Visual Studio 2008
.Net framework 2.0
.
The translucency is done using windows 7's Aero (available since windows vista). This won't be possible in windows xp
Well, as far I know, having per-pixel alpha window in WinXP is possible, you have to google about WS_EX_LAYERED, UpdateLayeredWindow with AC_SRC_ALPHA. However that means you need to write your own code for rendering process and that's quite complicated(to make efficiently)
Alternative solution would be to use WPF, all you have to do is:
<Window AllowTransparency="True" Opacity="0.5"><MediaElement Source="yourfile.wmv" /></Window>
and it should work.
精彩评论