[Update examples] findcolor and add new findcolor example

This commit is contained in:
vcaesar 2017-12-03 01:21:55 +08:00
parent bec112817b
commit fb382d9e8d
3 changed files with 14 additions and 2 deletions

4
.gitignore vendored
View File

@ -2,6 +2,10 @@
.DS_Store
.vscode
.idea
examples/bitmap/test.png
examples/bitmap/test.tif
examples/bitmap/test31.tif
test/test.png
# Debug files

View File

@ -36,7 +36,11 @@ func main() {
color := robotgo.GetColor(bitmap, 1, 2)
fmt.Println("color...", color)
cx, cy := robotgo.FindColor(bitmap, color, 1.0)
cx, cy := robotgo.FindColor(bitmap, robotgo.CHex(color), 1.0)
fmt.Println("pos...", cx, cy)
cx, cy = robotgo.FindColor(bitmap, 0xAADCDC)
fmt.Println("pos...", cx, cy)
cx, cy = robotgo.FindColorCS(388, 179, 300, 300, 0xAADCDC)
fmt.Println("pos...", cx, cy)
bit := robotgo.CaptureScreen(1, 2, 40, 40)

View File

@ -146,7 +146,11 @@ func bitmap() {
color := robotgo.GetColor(bitmap, 1, 2)
fmt.Println("color...", color)
cx, cy := robotgo.FindColor(bitmap, color, 1.0)
cx, cy := robotgo.FindColor(bitmap, robotgo.CHex(color), 1.0)
fmt.Println("pos...", cx, cy)
cx, cy = robotgo.FindColor(bitmap, 0xAADCDC)
fmt.Println("pos...", cx, cy)
cx, cy = robotgo.FindColorCS(388, 179, 300, 300, 0xAADCDC)
fmt.Println("pos...", cx, cy)
bit := robotgo.CaptureScreen(1, 2, 40, 40)