Update findbit api to classics

This commit is contained in:
vcaesar 2017-08-24 21:31:42 +08:00
parent e1cc58e554
commit 7ecdc2b938
5 changed files with 12 additions and 12 deletions

View File

@ -191,7 +191,7 @@ func main() {
bitmap := robotgo.CaptureScreen(10, 20, 30, 40)
fmt.Println("...", bitmap)
fx, fy := robotgo.FindBit(bitmap)
fx, fy := robotgo.FindBitmap(bitmap)
fmt.Println("FindBitmap------", fx, fy)
robotgo.SaveBitmap(bitmap, "test.png")

View File

@ -189,7 +189,7 @@ func main() {
bitmap := robotgo.CaptureScreen(10, 20, 30, 40)
fmt.Println("...", bitmap)
fx, fy := robotgo.FindBit(bitmap)
fx, fy := robotgo.FindBitmap(bitmap)
fmt.Println("FindBitmap------", fx, fy)
robotgo.SaveBitmap(bitmap, "test.png")

View File

@ -31,14 +31,14 @@ func main() {
fmt.Println("CaptureScreen...", bitmap)
// searches for needle in bitmap
fx, fy := robotgo.FindBitmap(bitmap)
fx, fy := robotgo.FindBit(bitmap)
fmt.Println("FindBitmap------", fx, fy)
bit := robotgo.CaptureScreen(1, 2, 40, 40)
fmt.Println("CaptureScreen...", bit)
fx, fy = robotgo.FindBit(bit)
fx, fy = robotgo.FindBitmap(bit)
fmt.Println("FindBitmap------", fx, fy)
fx, fy = robotgo.FindBit(bit, bitmap)
fx, fy = robotgo.FindBitmap(bit, bitmap)
fmt.Println("FindBitmap------", fx, fy)
// returns new bitmap object created from a portion of another

View File

@ -138,14 +138,14 @@ func bitmap() {
fmt.Println("CaptureScreen...", bitmap)
// searches for needle in bitmap
fx, fy := robotgo.FindBitmap(bitmap)
fx, fy := robotgo.FindBit(bitmap)
fmt.Println("FindBitmap------", fx, fy)
bit := robotgo.CaptureScreen(1, 2, 40, 40)
fmt.Println("CaptureScreen...", bit)
fx, fy = robotgo.FindBit(bit)
fx, fy = robotgo.FindBitmap(bit)
fmt.Println("FindBitmap------", fx, fy)
fx, fy = robotgo.FindBit(bit, bitmap)
fx, fy = robotgo.FindBitmap(bit, bitmap)
fmt.Println("FindBitmap------", fx, fy)
// returns new bitmap object created from a portion of another

View File

@ -571,8 +571,8 @@ func SetKeyboardDelay(x int) {
|______/ |__| |__| |__| |__| /__/ \__\ | _|
*/
// FindBit find the bitmap
func FindBit(args ...interface{}) (int, int) {
// FindBitmap find the bitmap
func FindBitmap(args ...interface{}) (int, int) {
var (
bit C.MMBitmapRef
sbit C.MMBitmapRef
@ -597,8 +597,8 @@ func FindBit(args ...interface{}) (int, int) {
return int(pos.x), int(pos.y)
}
// FindBitmap find the bitmap
func FindBitmap(args ...interface{}) (int, int) {
// FindBit find the bitmap
func FindBit(args ...interface{}) (int, int) {
var bit C.MMBitmapRef
bit = args[0].(C.MMBitmapRef)