⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.pas

📁 DSPack is a set of Components and class to write Multimedia Applications using MS Direct Show and Di
💻 PAS
字号:
unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DSPack, ExtCtrls, DirectShow9, jpeg, ImgList, ComCtrls;

type
  TForm1 = class(TForm)
    VideoWindow: TVideoWindow;
    FilterGraph: TFilterGraph;
    Button2: TButton;
    SnapShot: TImage;
    Button1: TButton;
    OpenDialog: TOpenDialog;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure Button2Click(Sender: TObject);
  private
    { D閏larations priv閑s }
  public

  end;

var
  Form1: TForm1;
implementation
uses activex;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog.Execute then
  begin
    FilterGraph.ClearGraph;
    FilterGraph.RenderFile(OpenDialog.FileName);
    FilterGraph.Play;
  end;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  FilterGraph.ClearGraph;
  FilterGraph.Active := false;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  Stream: TMemoryStream;
begin
  Stream:= TMemoryStream.Create;
  try
    if VideoWindow.VMRGetBitmap(Stream) then
      SnapShot.Picture.bitmap.LoadFromStream(Stream);
  finally
    Stream.Free;
  end;
end;

end.



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -