c# 如何制作RealPlayer 视频播放器
2010-05-27 21:32
411 查看
c# 如何制作RealPlayer 视频播放器
主要介绍了如何使用 RealPlayer G2 Control 控件
那么我们怎么获得到这个控件呢,很简单,操作方法如下
右单击工具箱对话框的【所有Windows窗体】标签页,在弹出浮动菜单中选择“选择项”则弹出【选择工具箱项】对话框在该对话框中切换到【Com 组件】标签页,
在列表试图中选择 RealPlayer G2 Control 选项 然后确定
则会自动在工具箱对话框【所有Windows窗体】标签页上新增加一个axRealAudiol控件像页面中拖动就可以了,
但是要注意:在默认状态下RealPlayer G2 Control控件不显示视频界面。 需要设置:
CtlControls 属性为”IMAGEWINDOW,CONTROLPANEL,STATUSBAR“后才能显示视频界面。
我简单做了一个样式大家可以看一下,实现了一些简单的操作,
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button10_Click(object sender, EventArgs e)
{
//浏览
OpenFileDialog mydol = new OpenFileDialog();
if (mydol.ShowDialog() == DialogResult.OK)
{
this.axRealAudio1.Source=mydol.FileName;
}
}
private void button11_Click(object sender, EventArgs e)
{
//播放
if (this.axRealAudio1.CanPlay())
{
this.axRealAudio1.DoPlay();
}
}
private void button12_Click(object sender, EventArgs e)
{
//停止
if (this.axRealAudio1.CanStop())
{
this.axRealAudio1.DoStop();
}
}
private void button13_Click(object sender, EventArgs e)
{
//暂停
if (this.axRealAudio1.CanPlayPause())
{
this.axRealAudio1.DoPlayPause();
}
}
private void button14_Click(object sender, EventArgs e)
{
//无声
if (this.button14.Text == "无声")
{
this.axRealAudio1.SetMute(true);
this.button14.Text = "有声";
}
else
{
this.axRealAudio1.SetMute(false);
this.button14.Text="无声";
}
}
}
}
主要介绍了如何使用 RealPlayer G2 Control 控件
那么我们怎么获得到这个控件呢,很简单,操作方法如下
右单击工具箱对话框的【所有Windows窗体】标签页,在弹出浮动菜单中选择“选择项”则弹出【选择工具箱项】对话框在该对话框中切换到【Com 组件】标签页,
在列表试图中选择 RealPlayer G2 Control 选项 然后确定
则会自动在工具箱对话框【所有Windows窗体】标签页上新增加一个axRealAudiol控件像页面中拖动就可以了,
但是要注意:在默认状态下RealPlayer G2 Control控件不显示视频界面。 需要设置:
CtlControls 属性为”IMAGEWINDOW,CONTROLPANEL,STATUSBAR“后才能显示视频界面。
我简单做了一个样式大家可以看一下,实现了一些简单的操作,
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button10_Click(object sender, EventArgs e)
{
//浏览
OpenFileDialog mydol = new OpenFileDialog();
if (mydol.ShowDialog() == DialogResult.OK)
{
this.axRealAudio1.Source=mydol.FileName;
}
}
private void button11_Click(object sender, EventArgs e)
{
//播放
if (this.axRealAudio1.CanPlay())
{
this.axRealAudio1.DoPlay();
}
}
private void button12_Click(object sender, EventArgs e)
{
//停止
if (this.axRealAudio1.CanStop())
{
this.axRealAudio1.DoStop();
}
}
private void button13_Click(object sender, EventArgs e)
{
//暂停
if (this.axRealAudio1.CanPlayPause())
{
this.axRealAudio1.DoPlayPause();
}
}
private void button14_Click(object sender, EventArgs e)
{
//无声
if (this.button14.Text == "无声")
{
this.axRealAudio1.SetMute(true);
this.button14.Text = "有声";
}
else
{
this.axRealAudio1.SetMute(false);
this.button14.Text="无声";
}
}
}
}
相关文章推荐
- c# 如何制作RealPlayer 视频播放器
- 如何在C#的WinForm中制作饼状图和柱状图
- 如何在C#的WinForm中制作饼状图和柱状图
- C# WinForm开发系列之如何使用panel控件制作左侧导航菜单
- 如何在C#的WinForm中制作饼状图和柱状图
- C#后台制作之数据库(二、如何清除显示以及将数据库数据导出到excel表格文件中)
- C#项目如何制作安装程序
- 如何用C#制作Excel AddIn
- C# Flowplayer(视频播放器)如何操作,使视频没有最大化
- 如何在C#的WinForm中制作饼状图和柱状图
- C#制作视频播放器-player播放器组件
- 如何用c#来制作一个activeX控件或类似的东西
- C# 安装程序制作,如何添加第三方DLL以及自定义的文件夹(如uploadFiles 文件夹)
- 如何在c#中进行调用vc制作的dll中的类
- 如何在C#的WinForm中制作饼状图和柱状图
- 如何在.Net的C#中制作DLL文件
- 如何用c#来制作一个activeX控件或类似的东西
- 计时精度到底毫秒级别或者更高 如何使用C#制作一个精确计时器
- 如何在.Net的C#中制作DLL文件
- C# Flowplayer(视频播放器)如何操作,使视频的时间进度不可操作