add more scale example

This commit is contained in:
vcaesar 2018-11-02 13:17:42 -04:00
parent f4cff13c0a
commit b6ddb6cb11

View File

@ -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)