go-vgo / robotgo

RobotGo, Go Native cross-platform RPA and GUI automation @vcaesar
Apache License 2.0
9.45k stars 859 forks source link

Not run code by packages `robotgo` and `gcv` #657

Closed Almazatun closed 1 month ago

Almazatun commented 1 month ago
package main

import (
    "fmt"

    "github.com/go-vgo/robotgo"
    "github.com/vcaesar/gcv"
)

func main() {
    targetImage := "../assets/image.png"

    img, _, err := robotgo.DecodeImg(targetImage)

    if err != nil {
        panic(err)
    }

    screen := robotgo.CaptureImg()

    x, y := gcv.FindX(screen, img)
    fmt.Println(x, y)
}

Description

I just tried to get `x, y` coordination by image on the captured screen, but faced issues below when running code.

... image

a13x212 commented 1 month ago

Try using the latest version. v0.110.1

Almazatun commented 1 month ago

Try using the latest version. v0.110.1

Thanks, I just ran go get -u github.com/go-vgo/robotgo. This is updated version of robotgo in go.mod.