robotgo icon indicating copy to clipboard operation
robotgo copied to clipboard

bitmap not working at all ?

Open ghost opened this issue 2 years ago • 5 comments

  1. Please speak English (English only), this is the language everybody of us can speak and write.
  2. Please take a moment to search that an issue doesn't already exist.
  3. Please make sure Golang, GCC is installed correctly before installing RobotGo.
  1. 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 ...

ghost avatar Oct 01 '22 07:10 ghost

BTW,I tested on mac ,win10,win11 , no platform works

ghost avatar Oct 01 '22 07:10 ghost

@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)

alchem1ster avatar Nov 25 '22 15:11 alchem1ster

@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

huayintianlai avatar Apr 29 '23 17:04 huayintianlai

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.

layxyer avatar Nov 15 '23 10:11 layxyer

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!

pizzahan avatar Jul 11 '24 06:07 pizzahan