Dzwebs.Net

撰写电脑技术杂文十余年

使用.NET如何实现视频播放上篇

Admin | 2007-11-12 19:30:16 | 被阅次数 | 6686

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

网上转载,未经测试,仅供参考

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


该杂文来自: 网站开发杂文

上一篇:NET操作IIS(添加虚拟目录、更改虚拟目录属性、删

下一篇:使用.NET如何实现视频播放中篇

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计