mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
Update GetPixelColor
This commit is contained in:
parent
4ea8a5eea5
commit
3deaefc81b
@ -44,8 +44,11 @@ type Bit_map struct {
|
|||||||
BytesPerPixel C.uint8_t
|
BytesPerPixel C.uint8_t
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetPixelColor(x, y C.size_t) string {
|
func GetPixelColor(x, y int) string {
|
||||||
color := C.aGetPixelColor(x, y)
|
cx := C.size_t(x)
|
||||||
|
cy := C.size_t(y)
|
||||||
|
color := C.aGetPixelColor(cx, cy)
|
||||||
|
// color := C.aGetPixelColor(x, y)
|
||||||
gcolor := C.GoString(color)
|
gcolor := C.GoString(color)
|
||||||
defer C.free(unsafe.Pointer(color))
|
defer C.free(unsafe.Pointer(color))
|
||||||
return gcolor
|
return gcolor
|
||||||
|
@ -13,6 +13,13 @@ func arobotgo() {
|
|||||||
robotgo.MoveMouse(x, y)
|
robotgo.MoveMouse(x, y)
|
||||||
robotgo.MoveMouse(100, 200)
|
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))
|
Println(robotgo.GetPixelColor(x, y))
|
||||||
|
|
||||||
color := robotgo.GetPixelColor(100, 200)
|
color := robotgo.GetPixelColor(100, 200)
|
||||||
|
Loading…
Reference in New Issue
Block a user