海康压缩卡在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;
相关文章推荐
- Delphi FireMonkey APP 如何获得当前系统语言设置
- 如何设置delphi程序托盘图标
- delphi 如何设置热键
- 如何设置一个严格30分钟过期的Session示例介绍
- delphi 如何设置快捷键之2
- 用Delphi开发的的组件如何使用自己设置的图标
- JS如何设置元素样式的方法示例
- Delphi如何设置主窗体
- delphi 中如何设置 Button 的 Caption 文字的对齐方式
- 如何使用WebBrowser控件打印格式化的XML文档,并以编程方式任意设置打印方向(C#完整示例)
- idhttp 在delphi7下如何设置代理IP和Port
- idhttp 在delphi7下如何设置代理IP和Port
- Delphi-- 如何设置程序开机运行(写注册表)
- delphi如何将子窗体的显示位置设置到主窗体的中间
- 如何设置delphi/cbuilder/BDE/MSSQL
- 如何设置Excel与Delphi关联导出完美报表【转】
- 如何设置Delphi编辑器当前一行的背景色
- 如何在网页中设置禁止查看源文件
- Exchange2007如何设置部分用户只允许在收发内部邮件,而不能收发外网邮件?