缩小一组高分辨率坐标?

发布于 2024-10-14 12:50:51 字数 1441 浏览 4 评论 0原文

这是问题的一些背景。我们正在使用 EyeVis 墙设置,请参阅此链接:http://www.eyevis.co.uk/< /a>

EyeVis 墙可以随时在墙上显示任意数量的“窗口”。我们查询墙壁的尺寸,然后查询墙壁上当前显示的所有窗户的列表。这将作为一组坐标返回,如下所示:

左、上、宽、高

因此,在这个阶段,我们知道了墙的大小,以及墙内显示的每个窗口的坐标。 我们需要做的是在控制器查看的监视器上显示墙壁布局的表示。然后控制器将选择一个窗口(从监视器),该窗口将在 EyeVis 墙上放大。

我尝试了一些方法,希望有一种简单的方法可以实现这一目标。我的一个想法是:

  1. 用代码创建一个具有墙壁尺寸的面板。
  2. 使用坐标将每个窗口添加到此面板。
  3. 将主面板添加到表单并停靠面板

我认为这会自动缩放主面板中的所有面板,我们会看到布局,但运行时的停靠似乎并不像我想象的那样?

这是我的代码:(使用 C#)

Panel mainPanel = new Panel();

mainPanel.Width = eyeVisWallWidth;
mainPanel.Height = eyeVisWallHeight;

foreach (Window thisWindow in windowList)
{
    Panel newWindow = new Panel();

    newWindow.Top = thisWindow.windowTop;
    newWindow.Width = thisWindow.windowWidth;
    newWindow.Height = thisWindow.windowHeight;
    newWindow.Left = thisWindow.windowLeft;

    Label newLabel = new Label();
    newLabel.Text = thisWindow.windowID.ToString() + ":" + newWindow.Height + ":" + newWindow.Width;
    newWindow.Controls.Add(newLabel);
    newWindow.BorderStyle = BorderStyle.FixedSingle;

    mainPanel.Controls.Add(newWindow);
}

this.panel1.Controls.Add(mainPanel);

mainPanel.Dock = DockStyle.Fill;
mainPanel.Anchor = AnchorStyles.None;

所以现在我开始认为这可能必须用数学来解决,这确实不是我的强项。有没有人有任何建议或指示可以帮助我解决这个问题?

任何帮助表示赞赏! 问候 阿德里安

Here is some background to the problem. We are working with an EyeVis wall setup, see this link: http://www.eyevis.co.uk/

The EyeVis wall can have any number of 'windows' displayed on the wall at any time. We query the wall for its size dimensions, and then query it for a list of all the windows currently being displayed on the wall. This comes back as a set of co-ordinates as follows:

Left, Top, Width, Height

So at this stage we have the size of the wall, and the co-ordinates of each window being displayed within that wall.
What we need to do is display a representation of the wall's layout on a monitor being viewed by the controller. The controller will then select one of the windows (from the monitor) and this window will be enlarged on the EyeVis wall.

I have tried a few things, in the hope that there might be a simple way to achieve this. One idea I had was this:

  1. Create a panel in code with the dimensions of the wall.
  2. Add each window to this panel using the co-ordinates.
  3. Add the main panel to a form and dock the panel

I thought this would auto scale all the panels within the main panel and we would see the layout, but docking at runtime doesn't seem to behave the way I imagined?

This is the code I had: (Using C#)

Panel mainPanel = new Panel();

mainPanel.Width = eyeVisWallWidth;
mainPanel.Height = eyeVisWallHeight;

foreach (Window thisWindow in windowList)
{
    Panel newWindow = new Panel();

    newWindow.Top = thisWindow.windowTop;
    newWindow.Width = thisWindow.windowWidth;
    newWindow.Height = thisWindow.windowHeight;
    newWindow.Left = thisWindow.windowLeft;

    Label newLabel = new Label();
    newLabel.Text = thisWindow.windowID.ToString() + ":" + newWindow.Height + ":" + newWindow.Width;
    newWindow.Controls.Add(newLabel);
    newWindow.BorderStyle = BorderStyle.FixedSingle;

    mainPanel.Controls.Add(newWindow);
}

this.panel1.Controls.Add(mainPanel);

mainPanel.Dock = DockStyle.Fill;
mainPanel.Anchor = AnchorStyles.None;

So now I'm starting to think this might have to be solved with math, which is really not my strong point. Does anyone have any advice or a pointer to something which might help me with this?

Any help appreciated!
Regards
Adrian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岛歌少女 2024-10-21 12:50:51

忘记关闭这个,我们只是将所有坐标除以一个公因数。

Forgot to close thise, we just ended up dividing all the co-ordinates by a common factor.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文