go-vgo/robotgo

captureScreen can't save windows and icon imformations

XeonSid opened this issue · 3 comments

  • Robotgo version (or commit ref):
  • Go version:1.12.5
  • Gcc version: clang 11.0.0
  • Operating system and bit: macos 10.15.3
  • Resolution:
  • Can you reproduce the bug at Examples:
    • Yes (provide example code)
    • No
    • [■] Not relevant
  • Provide example code:
package main

import (
  "fmt"
  "github.com/go-vgo/robotgo"
)

func main() {
  w,h:=robotgo.GetScreenSize()
  bitmap:=robotgo.CaptureScreen(0,0,w,h)
  fx,fy :=robotgo.FindBitmap(bitmap)
  fmt.Println(fx, fy)
  robotgo.SaveBitmap(bitmap,"a.png")
}
  • Log gist:

Description

when this program is done, "a.png" shows that then the desktop snapshot lacks window and icon information。
...

Have you given permission to the Terminal app for Screen Recording and Accessibility under: System Preferences > Security and Privacy > Privacy > Accessibility and Screen Recording (assuming that your are running the example program from the Terminal)?

I didn't realize that. I will give a try latter. THX

Given permission to the Terminal app for Screen Recording and Accessibility under: System Settings > Privacy and Security > Accessibility, Screen Recording.