GetWindowBounds返回翻转的坐标(石英) [英] GetWindowBounds returns flipped coordinates (Quartz)

查看:89
本文介绍了GetWindowBounds返回翻转的坐标(石英)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Carbon应用程序中呼叫::GetWindowBounds.

它返回我在屏幕上的Windows坐标,其中(0,0)点是屏幕的左上角.

我还使用CGWarpMouseCursorPosition函数,它的工作方式相同(根据我的期望,提供(0,0)是屏幕的左上角的坐标.

我有兴趣接收(0,0)是屏幕的左下角点的坐标. (根据文档,Quartz应该如何工作.)

这不是我的代码,我想有些标志/选项已设置为以这种方式工作.

有人可以提示我寻找什么吗?

I am calling ::GetWindowBounds in Carbon application.

It returns me windows coordinates in the screen where (0,0) point is Top-Left point of the screen.

I also use CGWarpMouseCursorPosition function and it works the same way (Expecting from me to provide coordinates where (0,0) is Top-Left point of the screen.

I am interested to receive the coordinates where (0,0) is Bottom-Left point of the screen. (Which is how Quartz should work according to documentation).

This is not my code and I guess somewhere some flag/option was set to work this way.

Can someone give me a hint what to look for?

Thanks!

推荐答案

应用程序可能已调用
It''s possible that the application has made a call to SetMapMode()[^] with one of the modes that uses bottom up orientation.


我不是Qt程序员, QPainter :: setWindow和QPainter :: setViewport帮助您完成与Win32 API执行的描述相似的操作.我没有看到如上所述与SetMapMode直接相关的任何功能.

这是描述Qt坐标系的参考链接:

http://doc.qt.nokia.com/latest/coordsys.html#window- viewport-conversion [ ^ ]

祝你好运.
I am not a Qt programmer, however, QPainter::setWindow and QPainter::setViewport help do similar things to what you are describing that the Win32 API performs. I did not see any function that directly correlates to SetMapMode as suggested above.

Here is a reference link that descripts coordinate systems for Qt:

http://doc.qt.nokia.com/latest/coordsys.html#window-viewport-conversion[^]

Good Luck.


这篇关于GetWindowBounds返回翻转的坐标(石英)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆