【文件属性】:
文件名称:C#分屏技术,可以实现监控分屏
文件大小:35KB
文件格式:RAR
更新时间:2014-09-01 10:22:52
C# Panel
实现了简单的监控视屏分屏浏览技术
///
/// 计算视频面板位置和面积
///
///
/// 总面积和坐标
///
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;
}
【文件预览】:
FenPing
----FenPing()
--------Form1.cs(2KB)
--------bin()
--------obj()
--------Properties()
--------Program.cs(468B)
--------Form1.Designer.cs(2KB)
--------Form1.resx(6KB)
--------FenPing.csproj(3KB)
----FenPing.sln(911B)
----FenPing.suo(12KB)