登录 注册
当前位置:主页 > 资源下载 > 50 > C#技术能够实现监控分屏功能

C#技术能够实现监控分屏功能

  • 更新:2024-10-06 19:00:50
  • 大小:35KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:C# - 后端
  • 格式:RAR

资源介绍

实现了简单的监控视屏分屏浏览技术 /// /// 计算视频面板位置和面积 /// /// /// 总面积和坐标 /// private IList CalcPanelRectangle(int channelCount, Size TotalArea) { IList result = new List(); //模数 int modulo; if (channelCount <= 4) modulo = 2; else if (channelCount > 64) modulo = 8; else modulo = (int)Math.Ceiling(Math.Sqrt(channelCount)); //平方根 int width, height; //单个画面大小 width = (TotalArea.Width - modulo * 1) / modulo; height = (TotalArea.Height - modulo * 1) / modulo; for (int i = 0; i < channelCount; i++) { Rectangle rect = new Rectangle(); //AxDICOMax.AxDICOMX rect = new AxDICOMax.AxDICOMX(); rect.Width = width; rect.Height = height; if (i % modulo == 0) { rect.X = 1; if (i == 0) rect.Y = 1; else rect.Y = result[i - modulo].Y + height + 1; } else { rect.X = result[i - 1].X + width + 1; rect.Y = result[i - 1].Y; } result.Add(rect); } return result; }