English 中文(简体)
如何在AxWindows MediaPlayer中播放 WinForms 资源视频?
原标题:How to play a video from WinForms resources in a axWindowsMediaPlayer?

有谁知道或知道 如何播放视频 从应用资源 到AxWindows MediaPlayer 组件?

我是说...

axWindowsMediaPlayer1.TheProperty = Resources.MyVideoResource;

这将是非常好的, 但我不认为这种财产存在..

问题回答

添加对您的工程的 Interop. axWMPLib 和 / 或 Interop. WMPLib 引用

(如果我不记得错误的 axWmpLib 与窗口 mp 一起工作, 如果在 pc 上找不到 wmp, wmplib 会与任何已安装的 - 或默认的媒体播放器自动连接, 支持 wmplib - i. winamp 或 splayer-. I just worked on this year- 2011 august- to my g.f. for her b-day. so it worked as before with a media list 包含 2 mp3 并且我直接给出这些代码, 除了路径以外 )

        private void axWindowsMediaPlayer1_ClickEvent(object sender, AxWMPLib._WMPOCXEvents_ClickEvent e)
        {
            axWindowsMediaPlayer1.URL = fullPathOfYourFirstMedia;
            axWindowsMediaPlayer1.Ctlcontrols.play(); // activates the play button
            axWindowsMediaPlayer1.Ctlcontrols.next(); // activates the next button
            WMPLib.IWMPMedia media = axWindowsMediaPlayer1.newMedia(fullPathOfYourSecondMedia);
            axWindowsMediaPlayer1.currentPlaylist.appendItem(media);
        }

如果您将媒体从资源中移除, 那么简单地将您的媒体添加到您的工程的顺序中, 并给整个路径字符串以“ code> Application. startup 开头 ” 。





相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签