procedure Tfrm_Main.VMRTextOut(AText: string);
var
VMRBitmap: TVMRBitmap;
begin
if AText = '' then
exit;
VMRBitmap := TVMRBitmap.Create(VideoWindow1);
with VMRBitmap, Canvasdo
begin
LoadEmptyBitmap(VideoWindow1.Width, VideoWindow1.Height, pf24bit, clSilver);
Source := VMRBitmap.Canvas.ClipRect;
Options := VMRBitmap.Options + [vmrbSrcColorKey];
ColorKey := clSilver;
Brush.Color := clSilver;
Font := frm_Option.AFont;
TextOut(0, 0, AText);
DrawTo(0, 0, 1, 1, 0.5);
end;
VMRBitmap.Free;
end;
procedure Tfrm_Main.A_FileExecute(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
A_Stop.Execute;
//停止
// frm_Option.FilterGraph.Mode := gmNormal;
frm_Option.FilterGraph.Active := True;
frm_Option.FilterGraph.RenderFile(OpenDialog1.FileName);
frm_Option.FilterGraph.Play;
VMRTextOut(frm_Option.E_Text.Text);
//字幕
Timer1.Enabled := True;
A_Play.Checked := True;
A_Capture.Enabled := False;
end;
end;
这里有源码
http://2ccc.com/article.asp?articleid=272