Giter VIP home page Giter VIP logo

Comments (15)

NateScarlet avatar NateScarlet commented on May 24, 2024 1

那我这边应该也处理下不同DPI

win32 应该有返回DPI缩放比率的

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

第二张也不对 正确的是无外边框纯内容 466x828 大小的

日志发一下

我没用 python 3.9 测试过 不知道是不是这个问题

from auto-derby.

a1oyss avatar a1oyss commented on May 24, 2024

第二张也不对 正确的是无外边框纯内容 466x828 大小的

日志发一下

我没用 python 3.9 测试过 不知道是不是这个问题

INFO [2021-06-01 10:31:25]:auto_derby.window:58: width=466 height=828
INFO [2021-06-01 10:31:25]:auto_derby.window:60: already in wanted size
INFO [2021-06-01 10:31:25]:main:52: game window: 788770
INFO [2021-06-01 10:31:28]:auto_derby.template:186: no match: tmpl=('connecting.png', 'retry_button.png', 'nurturing_command_training.png', 'nurturing_fans_not_enough.png', 'nurturing_finish_button.png', 'nurturing_formal_race_banner.png', 'nurturing_race_next_button.png', 'nurturing_option1.png', 'green_next_button.png', 'nurturing_ura_finals.png', 'nurturing_gene_inherit.png')

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

在这个页面这样显示是正常的 育成需要你手动选完卡进去之后才能自动

from auto-derby.

a1oyss avatar a1oyss commented on May 24, 2024

在这个页面这样显示是正常的 育成需要你手动选完卡进去之后才能自动

我也这样试过,但是问题是screenshot得到的图片是不正确的,识别不到按钮

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

是不是因为你游戏画面没全部显示在屏幕里 我看你任务栏挡住了

我双屏都没问题 这个直接调用的是windows自己的API 应该不大可能出错

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

第一张图的尺寸是对的 要不然就是 PIL.ImageGrab 的 bug

你在这里加个 print(locals()) 比较下坐标数据是不是对的 错的话是怎么错的

return ImageGrab.grab(bbox, True, True)

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

https://stackoverflow.com/questions/25467288/pils-imagegrab-is-capturing-at-the-wrong-resolution
或者是因为你系统 DPI 设置?

Stack Overflow
I'm trying to get a full screen (1920 x 1080) capture using this code. The saved images are only 1536 x 864 though.

solution: As Mark pointed out below, Windows has scaling which can be changed via

from auto-derby.

a1oyss avatar a1oyss commented on May 24, 2024

https://stackoverflow.com/questions/25467288/pils-imagegrab-is-capturing-at-the-wrong-resolution
或者是因为你系统 DPI 设置?

Stack Overflow**PIL's ImageGrab is capturing at the wrong resolution**I'm trying to get a full screen (1920 x 1080) capture using this code.
The saved images are only 1536 x 864 though.
solution: As Mark pointed out below, Windows has scaling which can be changed via

解决了。。。,确实是分辨率问题,笔记本有125%缩放导致坐标获取有偏移,感谢

Stack Overflow
I'm trying to get a full screen (1920 x 1080) capture using this code. The saved images are only 1536 x 864 though.

solution: As Mark pointed out below, Windows has scaling which can be changed via

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

不对 这个在pillow PR4000 里修了啊
https://github.com python-pillow Pillow/pull/4000
你是不是用的版本太老

GitHub
GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

from auto-derby.

a1oyss avatar a1oyss commented on May 24, 2024

不对 这个在pillow PR4000 里修了啊
https://github.com python-pillow Pillow/pull/4000
你是不是用的版本太老

GitHub**GitHub: Where the world builds software**GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

不是Pillow的原因,应该就是win32API的问题

GitHub
GitHub is where over 65 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

from auto-derby.

a1oyss avatar a1oyss commented on May 24, 2024

那我这边应该也处理下不同DPI

win32 应该有返回DPI缩放比率的

找到了一个解决方案
在__main__.py中添加
ctypes.windll.shcore.SetProcessDpiAwareness(2)
在缩放率125%的情况下是成功的,不知道其他缩放率下是否可以

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

https://github.com/python-pillow/Pillow/pull/4000/files#diff-a592fb63b483610c48cce81b875ed7d27e5a68cfcbc289340cd1f0326f12a781R355

PIL 用的是 SetThreadDpiAwarenessContext 不知道(Handle)-3是什么意思

其实这个应该算 PIL bug 因为它确实有尝试支持不同的 DPI

GitHub
Fixes #2438 and its duplicates #3432, #3626 for Windows 10 version 1607+ (Anniversary Update). This PR uses SetThreadDpiAwarenessContext to temporarily make Python DPI aware. This function returns ...

from auto-derby.

NateScarlet avatar NateScarlet commented on May 24, 2024

StackOverflow 回答下面有个用 SetProcessDPIAware 的

from ctypes import windll
windll.user32.SetProcessDPIAware()

from auto-derby.

a1oyss avatar a1oyss commented on May 24, 2024

StackOverflow 回答下面有个用 SetProcessDPIAware 的

from ctypes import windll
windll.user32.SetProcessDPIAware()

嗯,试过了,确实能行

from auto-derby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.