• Delphi初浅入门笔记之九:多媒体编程二(媒体播放器控件篇)


    媒体播放器控件

    unit Unit1;

    interface

    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, MPlayer, StdCtrls, ExtCtrls;

    type
      TForm1 = class(TForm)
        Panel1: TPanel;
        Button1: TButton;
        Button2: TButton;
        Button3: TButton;
        Button4: TButton;
        Button5: TButton;
        OpenDialog1: TOpenDialog;
        MediaPlayer1: TMediaPlayer;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
        procedure Button4Click(Sender: TObject);
        procedure Button5Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;

    var
      Form1: TForm1;

    implementation

    {$R *.dfm}

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    openDialog1.DefaultExt:='AVI';
    opendialog1.Filter:='所有文件(*.*)|*.*|avi文件|*.avi';
    openDialog1.FileName:='*.avi';
    if opendialog1.Execute then
    begin
        mediaplayer1.FileName:=opendialog1.FileName;
        mediaplayer1.Open;
    end;
    end;

    procedure TForm1.Button2Click(Sender: TObject);
    begin
    mediaplayer1.Next;
    end;

    procedure TForm1.Button3Click(Sender: TObject);
    begin
    mediaplayer1.Back;
    end;

    procedure TForm1.Button4Click(Sender: TObject);
    begin
    mediaplayer1.Pause;
    end;

    procedure TForm1.Button5Click(Sender: TObject);
    begin
    mediaplayer1.Play;
    end;

    end.

    源代码

  • 相关阅读:
    重新了解Java基础(六)-Java关键字
    重新了解Java基础(五)-Java标识符
    重新了解Java基础(四)-常用开发工具&注释简介
    CentOS 7 安装JDK
    一步一步教你自定义博客园(cnblog)界面
    如何设置文字的阴影
    如何实现2D动画
    跳转九宫格的制作
    风车的动图制作
    心跳的动图制作
  • 原文地址:https://www.cnblogs.com/liszt/p/1969450.html
Copyright © 2020-2023  润新知