mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-24 10:19:01 +00:00
[Update examples] findcolor and add new findcolor example
This commit is contained in:
parent
bec112817b
commit
fb382d9e8d
3 changed files with 14 additions and 2 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue