VLC如何在桌面上播放视频? [英] How does VLC play videos on the desktop?

查看:300
本文介绍了VLC如何在桌面上播放视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

前一段时间,我注意到VLC可以直接在桌面上播放视频。在学校里的Windows XP上,它在图标下方播放。当我在Windows 7上在家尝试时,它隐藏了图标。我不确定它是操作系统还是VLC的更新,但我有兴趣在图标下方播放它。

A while back, I noticed that VLC has the ability to play videos directly on the desktop. When I did so at my school, on Windows XP, it played underneath the icons. When I tried at home, on Windows 7, it hid the icons. I'm not sure if it's the operating system or if it's an update of VLC, but I'm interested in playing it underneath the icons.

注意到这一点后,我想出了制作各种动画桌面的想法。没什么特别的,只有一些精选视频供我自己使用。我最初的想法是在自己的窗口中播放视频(使用 mciSendString ),并对每个窗口进行 PrintWindow 框架,将其保存到文件,然后将桌面墙纸设置为文件。此后,我已经丢失了特定的代码,但是它并不能很好地工作,并且不用说,它的性能将非常糟糕。

After noticing this, I had an idea to make an animated desktop of sorts. Nothing special, just a few select videos for my own use. The idea I started with was to play a video in my own window (using mciSendString) and do a PrintWindow of each frame, save it to a file, and set the desktop wallpaper as the file. I've since lost the specific code, but it wasn't quite working, and, needless to say, would perform horribly.

回到它,我意识到总有一种比这更有效的方法,但我不太明白那是什么。

Coming back to it, I realized there must be a much more efficient way than that anyway, but I can't quite grasp what that is.

我尝试(现在都在Windows 7中)将视频的父窗口设置为 GetDesktopWindow ,以最大程度地减少所有窗口都在任务栏上的新窗口后面播放视频,但是可以通过单击aero偷看按钮或单击Win + D来查看桌面。

I tried (all in Windows 7 now) setting the video's parent window to GetDesktopWindow, to the effect of minimizing all windows leaving behind a new window on the taskbar playing the video, but being able to see the desktop through clicking the aero peek button or hitting Win+D.

然后在桌面的文件夹视图窗口的父窗口中尝试了相同的操作。结果是播放视频的尺寸相同的窗口,但是这一次,无法访问桌面,也没有创建新窗口。就像是在大多数台式机上播放一样,但是小工具在上方播放,并且由于播放窗口较小,因此仍显示向右下方的区域。

I then tried the same with a parent window of the desktop's folder view window. The result was the same dimensioned window playing the video, but this time, the desktop could not be accessed, and no new window was created. It's like it was playing over top of most of the desktop, but the gadgets go over top and the areas toward the right and bottom still show due to the smaller playing window size.

VLC如何在桌面上播放它,好像它是动态壁纸一样?使它在图标(和小工具,如果您添加到Windows 7中,应该是小工具)下面播放会很难吗?该程序本身将在Windows XP上使用。我不确定DirectShow是否可以提供任何帮助,但是除了MCI之外,我是否愿意使用它以及其他Windows API领域。如果有帮助,我希望解决方案使用C ++。 .NET也可以正常工作,但可能需要花费一些额外的时间。

What does VLC do to play it on the desktop itself, looking as if it's a dynamic wallpaper? Is it significantly harder to make it play underneath the icons (and gadgets if you add in Windows 7, I suppose)? The program itself will be used on Windows XP. I'm not sure if DirectShow has anything that might help, but I'm willing to use it, among other Windows API areas besides just MCI. I'd prefer the solution to be in C++, if it makes a difference. .NET would also work well, but might take a bit of extra time working in.

推荐答案

VLC将墙纸设置为特定的颜色,然后使用DirectDraw更新为桌面定义的覆盖表面内的颜色键。

VLC sets the wallpaper to a specific color, then uses DirectDraw to update that color key within an overlay surface defined for the desktop.

我自己从来没有做过,但是这里有一些地方值得一看有关更多信息:

I've never done it myself, but here are a few places to look for more information:

  • Overlay Color Keys
  • IDirectDrawSurface
  • VLC source code

这篇关于VLC如何在桌面上播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆