精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。”需要全文内容也请联系孙老师。
After I found that my previous movie player was broken by all the changes done to Vista, I started looking for a C# solution based on managed DirectX.
之后我发现我以前的视频播放器不支持Vista的更改,我开始寻找一个c#的基于托管DirectX的解决方案。
Everything I tried with the original Vista failed, until I downloaded the latest Microsoft DirectX 9L version from April 2007 that solved all my Vista problems.
我用Vista第一版本,尝试失败,直到我下载最新的微软2007年4月DirectX9 版本,才解决我所有的问题。
Thus in order to use this code with Vista (no problem running it under XP), you must first download the latest DirectX SDK from here.
因此为了在Vista下使用这段代码运行(XP没有问题),您必须先下载最新DirectXSDK 在这里 。
Then you will be able to use the Microsoft.DirectX.AudioVideoPlayback assembly.然后你将能够使用 Microsoft.DirectX.AudioVideoPlayback 组件。
Once you have installed the full DirectX SDK, and assuming you have installed it with the default setup, you can find the documentation about the AudioVideoPlayback assembly in this folder:一旦你已经安装了完整的DirectXSDK,假设您已经安装了它使用默认设置,你可以找到的文档 AudioVideoPlayback 装配在这个文件夹:
C:\Program Files\Microsoft DirectX SDK (April 2007)\Documentation\DirectX9\directx9_m.chm.C:\Program Files\MicrosoftDirectXSDK(2007年4月)\ \ DirectX9 \ directx9_m.chm文档。
zMoviePlayer is able to play: AVI, MPG, MPEG, WMV, DivX, Xvid (assuming that you have installed the right CODEC first). zMoviePlayer 能够播放:AVI,MPG,MPEG,WMV,和DivX,Xvid(假设您已经安装了正确的编解码器)。
While in "full screen" mode, move the mouse to the bottom to show/hide the "command panel".而在“全屏”模式,移动鼠标底部显示/隐藏”命令面板”。
To select a movie, use either the Menu to popup the common dialog file selector, or use Drag & Drop from the Explorer onto the zMoviePlayer form. 选择一个视频,使用菜单弹出通用对话框文件选择器,或者使用拖&探险家在下降 zMoviePlayer 的形式。
The main DirectX class of the player is named Video and it is very easy to use. 主要DirectX类玩家命名 视频 它非常容易使用。
You can get all the details about it from the Visual Studio popup contextual menu (get definition).你可以得到所有的细节从Visual Studio弹出上下文菜单(定义) 。
Because I wanted to have a nice looking interface "a la WMP 11", I have added a few classes myself to perform the skinning of the player. They are:因为我想有一个漂亮的界面“la买理财产品买11”,我添加了几类执行玩家的皮肤。 它们是:
SkinButton.cs - User control to create skinned button using one single 5-image bitmap matching each of the button states: normal, down, disabled, focused, hover. SkinButton。 cs - 使用一个用户控件来创建剥皮按钮5-image位图匹配的每个按钮状态:正常,下降,残疾,专注,盘旋。
You can use either "standard" push button or shaped button with region.您可以使用“标准”按钮或与区域形状的按钮。
SkinTrackbar.cs - User control to create a mouse only skinned track bar. The thumb tracker can have any size or shape based on a provided bitmap. The control orientation is based on the ratio between width and height, if width is larger than height, then horizontal else vertical. To help the user figure out the moving of the thumb track, the control uses different colors to show the current value. You can inverse ranging swapping min/max values.
SkinTrackbar。 cs - 用户控件创建一个鼠标只剥了皮的酒吧。 拇指跟踪器可以提供任何尺寸或形状基于位图。 控制取向是基于宽度和高度之间的比例,如果宽度大于高度,水平垂直。 帮助用户找出拇指的运动轨道,控制使用不同的颜色来显示当前值。 你可以逆不等交换最小/最大价值。
SkinEngine.cs - This class is responsible for the drawing of the skinned controls. SkinEngine.cs - - - - - - 该类负责剥皮的绘图控件。
To get rid of the "loaderlock" exception message while running in the Visual Studio environment: 摆脱“loaderlock”异常消息而在Visual Studio中运行环境:
Use "Ctrl + Alt + E" to open the Exceptions dialog box, select "Managed Debugging Assistants" and uncheck "Loaderlock". 使用“Ctrl + Alt + E”打开异常对话框中,选择“ 管理调试助手 ”, 取消 ” Loaderlock ”。
COMMAND line support (works also to drag movie file from Explorer onto the player's desktop icon if any)
命令行支持(工作也将视频文件从浏览器拖到玩家的桌面图标如果有的话)
PROCESS DETECTION: see IsAlreadyRunning()
过程检测: IsAlreadyRunning()
ICONIC mode detection to restore original location (when the command line is being used)
标志性的模式检测恢复原始位置(当使用命令行)
AUDIO LEVEL saved between sessions
音频会话之间保存程度
New label ShowTime (to see the current time while running in full screen mode)
新标签ShowTime(查看当前时间在全屏模式下运行)
Private WM_STRINGDATA message to play a new movie, using command line file name
私有 WM_STRINGDATA 消息新视频,使用命令行文件名称
Updated on 05-15-2007 (version 1.03)更新05-15-2007(1.03版本)This version saves the latest folder being used into the registry and retrieves it between sessions to ease movie selection (very handy when all the movies are stored into the same folder inside a dedicated sub-folder sorted by movie type).
这个版本保存最新的文件夹,文件夹被使用到视频选择时的注册和检索,这会让注册和检索更易用(非常方便,当按视频类型保存,所有的视频都存储到同一个文件夹在一个专门的子文件夹来)。
HD movies (WMV HD movies do not work on Vista)
高清视频(WMV高清视频在Vista不工作)
MUTE problem has been fixed (MUTE was ignored when playing a new movie even when ON)
静音问题已经解决(播放新的视频时静音忽略了)