首页 ┆网站地图 ┆游戏资讯 ┆天龙八部 ┆资源下载 ┆淘宝网购物 ┆淘宝数码产品 ┆淘宝数码相机 
设为首页
加入收藏
联系我们
高级搜索
您当前的位置: 主页 > NET专区 > WINFORM > asp.NET实现视频播放器功能代码
asp.NET实现视频播放器功能代码
来源: 发布时间:2007-11-09 浏览:人次  字体:[  
使用DirectX技术实现播放,需要引用系统的 C:\WINNT\system32\quartz.dll
是从CodeProject上看来的。前一阵看到有人需要这样的代码,所以贴出来共享一下。

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using QuartzTypeLib;

namespace Greystar.FrameWork.ToolKits
{
/// <summary>
/// FrmTV 的摘要说明。
/// </summary>
public class FrmTV : System.Windows.Forms.UserControl
{
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.ComponentModel.IContainer components;

private const int WM_APP = 0x8000;
private const int WM_GRAPHNOTIFY = WM_APP + 1;
private const int EC_COMPLETE = 0x01;
private const int WS_CHILD = 0x40000000;
private const int WS_CLIPCHILDREN = 0x2000000;

private FilgraphManager m_objFilterGraph = null;
private IBasicAudio m_objBasicAudio = null;
private IVideoWindow m_objVideoWindow = null;
private IMediaEvent m_objMediaEvent = null;
private IMediaEventEx m_objMediaEventEx = null;
private IMediaPosition m_objMediaPosition = null;
private IMediaControl m_objMediaControl = null;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;

enum MediaStatus { None, Stopped, Paused, Running };

private MediaStatus m_CurrentStatus = MediaStatus.None;

public FrmTV()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent();

// TODO: 在 InitializeComponent 调用后添加任何初始化

}
public FrmTV(EnvDTE._DTE dte,string workpath)
{
InitializeComponent();
this.mDTE=dte;
this.mWorkPath=workpath;
}
private _DTE mDTE=null;
public _DTE DTE
{
set
{
mDTE=value;
}

get
{
return mDTE;
}
}

//工作目录
private string mWorkPath=null;
public string WorkPath
{
set
{
this.mWorkPath=value;
}
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmTV));
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.panel1 = new System.Windows.Forms.Panel();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton4,
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(288, 28);
this.toolBar1.TabIndex = 0;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 3;
//
// toolBarButton1
//
this.toolBarButton1.Enabled = false;
this.toolBarButton1.ImageIndex = 0;
//
// toolBarButton2
//
this.toolBarButton2.Enabled = false;
this.toolBarButton2.ImageIndex = 1;
//
// toolBarButton3
//
this.toolBarButton3.Enabled = false;
this.toolBarButton3.ImageIndex = 2;
//
// imageList1
//
this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth24Bit;
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Red;
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Black;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 28);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(288, 252);
this.panel1.TabIndex = 4;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// statusBar1
//
this.statusBar1.Location = new System.Drawing.Point(0, 260);
this.statusBar1.Name = "statusBar1";
this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1,
this.statusBarPanel2,
this.statusBarPanel3});
this.statusBar1.ShowPanels = true;
this.statusBar1.Size = new System.Drawing.Size(288, 20);
this.statusBar1.TabIndex = 5;
//
// statusBarPanel1
//
this.statusBarPanel1.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
this.statusBarPanel1.BorderStyle = System.Windows.Forms.StatusBarPanelBorderStyle.None;
this.statusBarPanel1.Text = "准备";
this.statusBarPanel1.Width = 144;

共2页: 上一页 1 [2] 下一页
↑上一篇:没有了
 
相 关 文 章 发布商链接
·winform窗体启动时怎么位于屏幕右下...
·WebBrowser页面与WinForm交互技巧分...
·Winform程序怎么降低占用的内存?
·WebBrowser控件怎么打开新页面后仍保...
·c#实现datagridview控件转datatable...
·MDI子窗口最大化怎么隐藏管理菜单?
·winform窗体的单例模式使用方法
·Winform的ToolTip控件简单用法介绍
·ListBox控件绑定自定义对象实例
·winform退出或关闭窗体时弹窗提示代...
 §最新评论:(评论内容只代表网友观点,与本站立场无关!)淘宝店铺一条街淘宝运动鞋淘宝网热门男装
网名:  验证码:  【所有评论】【↑返回顶部
评 分:12345
评论内容:(不能超过500字,请自觉遵守互联网相关政策法规。[按 Ctrl+Enter 可直接提交]
注意:请勿在本站发布政治话题、色情及违反法律的内容。
IT知道网 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。
推 荐 文 章
·WinForm小技巧实现CheckBox控
·解决DataGridView刷新数据不...
·DataGridView控件如何自动添...
·Winform利用异步上传数据,并...
·Winform如何递归删除TreeView
·DataGridView控件利用WebClie...
·DataGridView控件显示图片文...
·ComboBox控件绑定数据源如何...
·Winform利用WebSerivce传递图
·winform实现QQ显示或隐藏的效
·Winform实现中文简体繁体互相
·Winform如何利用委托实现窗体
推 荐 主 题
java专题.net开发php学习
数据库windows7Word技巧
天龙八部QQ技巧IT职场
javascriptPhotoShop 淘宝购物
图 文 推 荐
WinForm小技巧实现CheckBox控件长文字换行功能WinForm小技巧实现CheckBox控件长文字换行功能
DataGridView控件利用WebClient异步加载并显示网络上的图片DataGridView控件利用WebClient异步加载并显示网络上的图片
Winfrom实用技巧实现表单的打印功能Winfrom实用技巧实现表单的打印功能
热 门 文 章
·winform编程DataGridView控件...
·Winform窗体之间传值的几种方...
·DataGridView控件如何实现分...
·winform实现窗体嵌入并操作可...
·DataGridView编辑单元格时显...
·C#的简单图片透明处理代码以...
·在.net中利用webbrowser控件...
·DataGridView添加合计行并始...
·winform实现类似QQ滑动面板的...
·使用C#制做进程监视器,可查看...
·winform中DatagridView单元格...
·winform父窗口中调用子窗口,...
热 门 关 键 字
 网站首页 - 关于本站 - 加入收藏 - 网站地图 - 淘宝购物 - 在线留言 - 广告服务 - 返回顶部
Copyright © 2007 IT知道网.[冀ICP备07026896号]. All Rights Reserved .