给你一段代码看看,是以前我用天敏sdk2000开发的一个采集程序
procedure SaveJpgFile(iCardNo:SmallInt;VideoInNum:Smallint;
SbId:string;StatusFlag:String);
var
time1,time2,timeLen
WORD;
DirName,FileName:string;
TimeStr1,TimeStr2:string;
begin
TimeStr1:=FormatDateTime('hhmmss',Time);
// TimeStr2:=Copy(TimeStr1,1,2)+'.'+Copy(TimeStr1,4,2)+Copy(TimeStr1,7,2);
DirName:='d:/'+SbId ;
if not DirectoryExists(DirName) then
if not CreateDir(DirName) then
raise Exception.Create('创建目录失败');
DirName:=DirName+'/'+StatusFlag ;
if not DirectoryExists(DirName) then
if not CreateDir(DirName) then
raise Exception.Create('创建目录失败');
// ShortDateFormat := 'yyyy-mm-dd';
// ShortDateFormat := 'mm/dd/yyyy';
FileName:= DirName+'/'+Formatdatetime('yyyymmdd',Date)+'-'+TimeStr1+'.jpg';
case iCardNo of
0: begin
CapView.SDK_20001.Run ;
CapView.SDK_20001.VideoSource := VideoInNum;
CapView.SDK_20001.Visible := True;
//----延时捕获帧
time1 := GetTickCount();
time2 := time1;
timeLen := 500;
repeat
CapView.SDK_20001.EditCopy ;
time2 := GetTickCount();
Application.ProcessMessages ;
until time2-time1>timeLen;
CapView.SDK_20001.SaveImageToJpg(FileName,80);
end;
// end case 0
1: begin
CapView.SDK_20002.Run ;
CapView.SDK_20002.VideoSource := VideoInNum;
CapView.SDK_20002.Visible := True;
//----延时捕获帧
time1 := GetTickCount();
time2 := time1;
timeLen := 500;
repeat
CapView.SDK_20002.EditCopy ;
time2 := GetTickCount();
Application.ProcessMessages ;
until time2-time1>timeLen;
CapView.SDK_20002.SaveImageToJpg(FileName,80);
end;
//end case of 1
2: begin
CapView.SDK_20003.Run ;
CapView.SDK_20003.VideoSource := VideoInNum;
CapView.SDK_20003.Visible := True;
//----延时捕获帧
time1 := GetTickCount();
time2 := time1;
timeLen := 500;
repeat
CapView.SDK_20003.EditCopy ;
time2 := GetTickCount();
Application.ProcessMessages ;
until time2-time1>timeLen;
CapView.SDK_20003.SaveImageToJpg(FileName,80);
end;
//end case of 1
end;
// end case
end;
//---------- end SaveJpgFile;