?? main.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 + -