海康的DS-4004HC 视频卡抓图问题(50分)

G

guanrui

Unregistered / Unconfirmed
GUEST, unregistred user!
海康的DS-4004HC 视频卡
抓拍图象的函数GetJpegImage(HANDLE hChannelHandle,UCHAR *ImageBuf,ULONG *Size,UINT nQuality);
参数分别是 视频通道 图象指针 图象大小 质量
我这样调用的
GetJpegImage(5,@Image.@size,100)
Image是个TPicture对象 size是个DWord对象
不知道为什么老抓不上 谢谢 各位了
 
海康板卡客户群中有相应的: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;
 
谢谢了 那个群 我加了 说满了 郁闷啊
呵呵 太感谢你了 我明天去试下
 
忘了 说了 明天 试了 没问题就结贴了 再次感谢~
 
多人接受答案了。
 
顶部