diff --git a/cmd/color-pos/main.go b/cmd/color-pos/main.go deleted file mode 100644 index 64e4dcb1..00000000 --- a/cmd/color-pos/main.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/go-vgo/robotgo" -) - -func colorPicker() { - // click the left mouse button to get the value - m := robotgo.AddEvent("mleft") - if m { - x, y := robotgo.GetMousePos() - fmt.Println("mouse pos: ", x, y) - - clo := robotgo.GetPixelColor(x, y) - fmt.Println("color: #", clo) - - // clipboard - s1 := fmt.Sprint(x, ", ", y) + ": " + "#" + clo - err := robotgo.WriteAll(s1) - if err != nil { - fmt.Println("clipboard err: ", err) - } - } -} - -func main() { - fmt.Println("color picker: ") - fmt.Println("click the left mouse button to get the value.") - for { - colorPicker() - } -} diff --git a/examples/scale/main.go b/examples/scale/main.go index cf822ffc..71e7371d 100644 --- a/examples/scale/main.go +++ b/examples/scale/main.go @@ -14,7 +14,8 @@ func main() { fmt.Println("get scale screen size: ", width, height) bitmap := robotgo.CaptureScreen(0, 0, width, height) - robotgo.SaveBitmap(bitmap, "test.png") + // robotgo.SaveBitmap(bitmap, "test.png") + robotgo.Save(robotgo.ToImage(bitmap), "test.png") sx := robotgo.ScaleX() s := robotgo.Scale() @@ -27,7 +28,8 @@ func main() { 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") + // robotgo.SaveBitmap(bit1, "test2.png") + robotgo.Save(robotgo.ToImage(bit1), "test2.png") clo := robotgo.GetPixelColor(robotx, roboty) fmt.Println("GetPixelColor...", clo) diff --git a/examples/screen/main.go b/examples/screen/main.go index 53fdb009..2b8dee15 100644 --- a/examples/screen/main.go +++ b/examples/screen/main.go @@ -27,7 +27,7 @@ func bitmap() { fmt.Println("GoCaptureScreen...", gbitMap.Width) // fmt.Println("...", gbitmap.Width, gbitmap.BytesPerPixel) - robotgo.SaveCapture("saveCapture.png", 10, 20, 100, 100) + // robotgo.SaveCapture("saveCapture.png", 10, 20, 100, 100) } func color() {