robotgo
robotgo copied to clipboard
bitmap not working at all ?
- Please speak English (English only), this is the language everybody of us can speak and write.
- Please take a moment to search that an issue doesn't already exist.
- Please make sure
Golang, GCC
is installed correctly before installing RobotGo.
- Please give all relevant information below for bug reports, incomplete details will be handled as an invalid report.
You MUST delete the content above including this line before posting, otherwise your issue will be invalid.
- Robotgo version (or commit ref):
- Go version: go version go1.19.1 windows/amd64
- Gcc version:gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)
- Operating system and bit: Microsoft Windows 11 专业版 x64
- Resolution:
- Can you reproduce the bug at Examples:
- [ ] Yes (provide example code)
- [ ] No
- [ ] Not relevant
- Provide example code:
bitmap example code from readme
- Log gist:
bitmap... &{0x1e2f82867b0 30 40 120 32 4 [0 0]}
FindBitmap------ -1 -1
Find all bitmap: []
FindBitmap------ 10 20
Description
bitmap.FindAll seems Find all bitmap got no result ...
BTW,I tested on mac ,win10,win11 , no platform works
@never-afk
Use it like robotgo.FindBitmap(img_to_search, source_image, 0.5)
For some reason. you need to specify tolerance
value >0 even if images identical
img_raw := robotgo.ImgToBitmap(openPng("example.png"))
img := robotgo.ToCBitmap(img_raw)
screen := robotgo.CaptureScreen(x, y, w, h)
defer robotgo.FreeBitmap(screen)
fx, fy := robotgo.FindBitmap(img, screen, 0.5) // <- 0.5 tolerance for example
fmt.Println(fx, fy)
@never-afk 出于某种原因 喜欢使用它。即使图像相同,
robotgo.FindBitmap(img_to_search, source_image, 0.5)
您也需要指定值 >0tolerance
img_raw := robotgo.ImgToBitmap(openPng("example.png")) img := robotgo.ToCBitmap(img_raw) screen := robotgo.CaptureScreen(x, y, w, h) defer robotgo.FreeBitmap(screen) fx, fy := robotgo.FindBitmap(img, screen, 0.5) // <- 0.5 tolerance for example fmt.Println(fx, fy)
Changed so many function names, FindBitMap also changed, ah ~ ~ ~, gone, not playing
The API of this library has been changing too frequently. Even with the latest version that I downloaded, I couldn't run the examples provided in the documentation because some methods are missing.
The API of this library has been changing too frequently. Even with the latest version that I downloaded, I couldn't run the examples provided in the documentation because some methods are missing.
I agree with you, FindBitmap already gone!