海康板卡客户群中有相应的:29147889
procedure TDvr_Main.GraspVideoPictureJPG(ChannelHandle: Longint; FileName: PChar); //JPG抓图
var
ImgSize : integer;
imageBuf : array[1..704 * 576 * 2] of byte;
ret,jpegQuality:integer;
pFile: File;
begin
if ChannelHandle=-1 then
Exit;
ImgSize:=704*576*2;
jpegQuality:=100;
ret:=GetJpegImage(ChannelHandle,@imageBuf,@ImgSize,jpegQuality);
if(ret=0) then
begin
AssignFile(pFile,FileName );
Rewrite(pFile,imgsize);
BlockWrite(pFile, imageBuf,1);
CloseFile(pFile);
end
end;
procedure TDvr_Main.Dvr_CaptureBtnClick(Sender: TObject);//视频截图
begin
if sel <> -1 then
begin
//文件目录
FilePath := FormatDateTime('yyyymmdd', Date) + '/';
//文件名
FileName := FormatDateTime('hhmmnn', Current_Time);
//通道信息
hChannelHandle[sel] :=sel+1;
//根目录
RootPath := 'd:/视频截图/';
NowPath := RootPath + FilePath+inttostr(hChannelHandle[sel])+'路'+'/' ;
ForceDirectories(NowPath);
// NowName := NowPath+FileName+'.BMP';
NowName := NowPath+FileName+'.jpg';
// GraspVideoPicture(sel, Pchar(NowName));
GraspVideoPictureJPG(sel, Pchar(NowName));
//提示信息
VideoRecord.Panels[3].Text := '第'+inttostr(hChannelHandle[sel])+'路'+ '图片已截取';
end
else
begin
//提示信息
VideoRecord.Panels[3].Text := '请选择摄像机';
end;
end;