python - Python - Find Coordinates Relative to Screen
问题描述
Hi I'm not really sure how to phrase this question but basically,
x1: 575, y1: 76, x2: 1585, y2: 780
is the window position on my screen which is 1920x1080
The smaller box in the window, x1: 539, y1: 257, x2: 752, y2: 498
is relative to the window which is the above coordinates
I'm trying to calculate the x1, y1, x2, y2
of the smaller box relative to my screen 1920x1080
.
It's more of a maths problem and i'm completely lost on how to do this haha e_e
Expected answer is : x1: 1120, y1: 337, x2: 1333, y2: 574
+- a bit of offset because all of the above values and this expected values are measured in paint on my PC haha e_e
Please help any of you maths wiz out there! :(
解决方案
这是一道数学题,你是对的。
absolutex1 = outerx1 + innerx1
absolutey1 = outery1 + innery1
absolutex2 = outerx1 + innerx2
absolutey2 = outery1 + innery2
查看内部时,它仅与外部 x1,y1 相关。
推荐阅读
- java - 在 android 中过滤掉来自 OEM 的不需要的系统应用程序
- c - 系统调用返回值如何传回用户进程?
- python - 在将 django 表单保存到 mssql 数据库时,将数据类型 nvarchar 转换为数字时出错
- r - 在 R 中检索损坏的越南语字符串变量
- c++ - ESP8266 无需网络即可发送和接收数据
- python - numpy.array() 是抽象数据类型吗?
- jdbc - 尝试检索列名,但通过 IBM JDBC 驱动程序从元数据中获取列索引
- javascript - 如何使用 JS 将特定元素从 for 循环中获取到单独的数组中
- ios - 自更新 xcode 以来,资产的本地化不再有效
- php - 突出显示foreach循环中的最大值和最小值