mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
add more scale example
This commit is contained in:
parent
f4cff13c0a
commit
b6ddb6cb11
@ -18,11 +18,15 @@ func main() {
|
||||
|
||||
sx := robotgo.ScaleX()
|
||||
s := robotgo.Scale()
|
||||
robotx := 35 * s / 100
|
||||
roboty := 25 * s / 100
|
||||
robotx, roboty := 35*s/100, 25*s/100
|
||||
fmt.Println("scale: ", sx, s, " pos: ", robotx, roboty)
|
||||
|
||||
bit1 := robotgo.CaptureScreen(0, 0, robotx, roboty)
|
||||
mx, my := robotgo.GetMousePos()
|
||||
sx, sy := mx*s/100, my*s/100
|
||||
|
||||
rx, ry, rw, rh := sx, sy, robotx, roboty
|
||||
// bit1 := robotgo.CaptureScreen(10, 20, robotw, roboth)
|
||||
bit1 := robotgo.CaptureScreen(rx, ry, rw, rh)
|
||||
robotgo.SaveBitmap(bit1, "test2.png")
|
||||
|
||||
clo := robotgo.GetPixelColor(robotx, roboty)
|
||||
|
Loading…
Reference in New Issue
Block a user