mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 17:59:12 +00:00
Update GetPixelColor
This commit is contained in:
parent
4ea8a5eea5
commit
3deaefc81b
2 changed files with 12 additions and 2 deletions
|
|
@ -44,8 +44,11 @@ type Bit_map struct {
|
|||
BytesPerPixel C.uint8_t
|
||||
}
|
||||
|
||||
func GetPixelColor(x, y C.size_t) string {
|
||||
color := C.aGetPixelColor(x, y)
|
||||
func GetPixelColor(x, y int) string {
|
||||
cx := C.size_t(x)
|
||||
cy := C.size_t(y)
|
||||
color := C.aGetPixelColor(cx, cy)
|
||||
// color := C.aGetPixelColor(x, y)
|
||||
gcolor := C.GoString(color)
|
||||
defer C.free(unsafe.Pointer(color))
|
||||
return gcolor
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@ func arobotgo() {
|
|||
robotgo.MoveMouse(x, y)
|
||||
robotgo.MoveMouse(100, 200)
|
||||
|
||||
robotgo.MouseToggle("up")
|
||||
|
||||
for i := 0; i < 1080; i += 1000 {
|
||||
Println(i)
|
||||
robotgo.MoveMouse(800, i)
|
||||
}
|
||||
|
||||
Println(robotgo.GetPixelColor(x, y))
|
||||
|
||||
color := robotgo.GetPixelColor(100, 200)
|
||||
|
|
|
|||
Loading…
Reference in a new issue