c# - 在 C# 中,图像应保持在屏幕大小上的选项卡视图的中心
问题描述
我有一个选项卡控件,它包含 1 个选项卡视图,其中有 3 个不同的图片框,其中包含 3 个不同的图像,除了彼此之外,现在的问题是我已经根据我的显示器设置设置了图片框,但我想要的是表单和图片框应该与任何屏幕设置完全相同,无论是低分辨率还是高分辨率,我尝试并实现了其中一个图片框,但无法相应地设置另一个,任何人都可以告诉我怎么做吗?图像应相应地保留在选项卡视图的中心,如下所示。
Bitmap b = new Bitmap(500, 500);
pbox_View_Angle.Size = b.Size;
var left = (tabPage1.ClientRectangle.Width - pbox_View_Angle.ClientRectangle.Width) / 4;
var top = (tabPage1.ClientRectangle.Height - pbox_View_Angle.ClientRectangle.Height) / 2;
pbox_View_Angle.Location = new Point(tabPage1.ClientRectangle.Location.X + left, tabPage1.ClientRectangle.Location.Y + top);
pbox_View_Height.Location = new Point(tabPage1.ClientRectangle.Location.X + left + 400, tabPage1.ClientRectangle.Location.Y + top);
pbox_View_Azimuth.Location = new Point(tabPage1.ClientRectangle.Location.X + left + 800, tabPage1.ClientRectangle.Location.Y + top);`
解决方案
推荐阅读
- android - 自适应图标的 WebApp manifest.json
- file - dart:如何保存文件?
- assembly - Nasm 64 位 - 为什么输出以 ASCII 显示?
- attributes - 使用 StAX 找不到属性
- c# - 是什么让这些异步方法调用不同?
- ios - 当用户离开当前屏幕时,ARKit 应用应该做什么?
- algorithm - 每个递归算法都是分而治之的算法吗?
- python - 在线程化的 Python OpenCV 程序中是否有更好的方法来捕获密钥、Cttl-c 和杀死?
- python - Python:无法从 Socket 接收所有数据
- python - 选择排序:列表经过多少次排序后?