您的位置:首页 > 编程语言 > Delphi

海康压缩卡在delphi中如何设置OSD示例

2007-12-01 08:03 661 查看
 
procedure TDvr_Main.BitBtn1Click(Sender: TObject); //设置OSD
var
 i:integer;
begin
 for i:=0 to DSPChannl-1 do
 begin
    SetOSDFormat(i);
    setosd(i,true);
 end;
end;
function TDvr_Main.SetOSDFormat(i: Integer):BOOLEAN; //设置视频OSD
var
 L,m,nLength: Integer;
 Format1,Format2:array[0..40] of Word ;
 wFormat:WORD ;
 str:String ;
 wH,wL:char ;
begin
 Format1[0]:=16;
 Format1[1]:= 272;
 Format2[0]:= SpinEdit1.Value;
 Format2[1]:= SpinEdit2.Value;
 if not(RadioGroup1.ItemIndex=0) then //0:显示日期,1:不显示日期
    Format2[2]:=Ord(#0)
 else
 begin
    Format2[2]:= _OSD_YEAR4 ;
    Format2[3]:= Ord('-') ;
    Format2[4]:= _OSD_MONTH2 ;
    Format2[5]:= Ord('-') ;
    Format2[6]:= _OSD_DAY ;
    if (RadioGroup3.ItemIndex=0) then   //0:显示时间 ,1:不显示时间
    begin
      Format2[7]:= Ord(' ') ;
      Format2[8]:= _OSD_HOUR24 ;
      Format2[9]:= Ord(':') ;
      Format2[10]:= _OSD_MINUTE ;
      Format2[11]:= Ord(':') ;
      Format2[12]:= _OSD_SECOND ;
      Format2[13]:= Ord(#0) ;
      end
      else
      Format2[7]:= Ord(#0) ;
 end;
/////////////////////////////////////////////
 L := 0;
 Format1[0]:= SpinEdit3.Value;
 Format1[1]:= SpinEdit4.Value;
 if (RadioGroup4.ItemIndex=0) then
 begin
    str:='第'+''+ inttostr(i+1)+''+'路';
 if (RadioGroup2.ItemIndex=0) then
 begin
    str:=trim(edit4.Text);
 end;  
    nLength:= Length(str);
    m:=1;
     while m < nLength+1 do
     begin
       wH:=str[m];
       wL:=str[m + 1];
       if (ord(wH) > 128)   then
       begin
         m:=m+1;
         wFormat:= ord(wH) * 16 * 16 + ord(wL);
       end
       else
       wFormat:= ord(wH);
       Format1[L + 2]:= wFormat;
       L:=L+1;
       m:=m+1;
 end;
 Format1[L + 2]:= Ord(#0);
 end
 else
 Format1[2]:= Ord(#0);
 SetOsdDisplayMode(i,255, false,1, @Format1, @Format2);
 Result :=True;
end;
 
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息