mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13: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
|
||||
}
|
||||
|
||||
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 New Issue
Block a user