C# 视频监控系列(10):服务器端——验证、设置画面质量、字幕叠加、板卡序列号
2009-04-08 08:23:36 来源:WEB开发网VC ++ Code:
方法OnSettings()
USHORT Format1[40] = {48, 16, 'H','I','K','V', 'I','S','I','O','N', ''};
USHORT Format2[40] = {24, 50, _OSD_YEAR4, '-',_OSD_MONTH2,'-',_OSD_DAY,'-', _OSD_HOUR24, ':', _OSD_MINUTE,':', _OSD_SECOND, ''};
//其他代码
for(i = 0; i < GetTotalDSPs(); i++){
SetOsdDisplayMode(ChannelHandle[i], 255, TRUE, 0, Format1, Format2);
SetOsd(ChannelHandle[i], TRUE);
}
C# Code:
private const ushort _OSD_BASE = 0x9000;
private const ushort _OSD_YEAR4 = _OSD_BASE + 0;
private const ushort _OSD_YEAR2 = _OSD_BASE + 1;
private const ushort _OSD_MONTH3 = _OSD_BASE + 2;
private const ushort _OSD_MONTH2 = _OSD_BASE + 3;
private const ushort _OSD_DAY = _OSD_BASE + 4;
private const ushort _OSD_WEEK3 = _OSD_BASE + 5;
private const ushort _OSD_CWEEK1 = _OSD_BASE + 6;
private const ushort _OSD_HOUR24 = _OSD_BASE + 7;
private const ushort _OSD_HOUR12 = _OSD_BASE + 8;
private const ushort _OSD_MINUTE = _OSD_BASE + 9;
private const ushort _OSD_SECOND = _OSD_BASE + 10;
/// <summary>
/// 设置Osd
/// </summary>
/// <param name="ChannelHandle"></param>
/// <param name="setValue"></param>
public void SetOsd(IntPtr[] ChannelHandle, bool setValue)
{
if (setValue)
{
ushort[] Format1 = new ushort[]{ 48, 16, 'H', 'I', 'K', 'V', 'I', 'S', 'I', 'O', 'N', '' };
ushort[] Format2 = new ushort[]{ 24, 50, _OSD_YEAR4, '-', _OSD_MONTH2, '-', _OSD_DAY, '-', _OSD_HOUR24, ':', _OSD_MINUTE, ':', _OSD_SECOND, '' };
for (int i = 0; i < ChannelHandle.Length; i++)
{
HikVisionSDK.SetOsdDisplayMode(ChannelHandle[i], 255, true, 0, Format1, Format2);
HikVisionSDK.SetOsd(ChannelHandle[i], true);
}
}
else
{
for (int i = 0; i < ChannelHandle.Length; i++)
{
HikVisionSDK.SetOsd(ChannelHandle[i], false);
}
}
}
更多精彩
赞助商链接