mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-03 07:33:55 +00:00
Update golint
This commit is contained in:
parent
fcef4cca0e
commit
24d7ade1fe
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
. "fmt"
|
. "fmt"
|
||||||
|
|
||||||
"github.com/go-vgo/robotgo"
|
"github.com/go-vgo/robotgo"
|
||||||
// "go-vgo/robotgo"
|
// "go-vgo/robotgo"
|
||||||
)
|
)
|
||||||
@ -56,8 +57,9 @@ func main() {
|
|||||||
// robotgo.CaptureScreen()
|
// robotgo.CaptureScreen()
|
||||||
// bit_map := robotgo.CaptureScreen()
|
// bit_map := robotgo.CaptureScreen()
|
||||||
// Println("CaptureScreen...", bit_map)
|
// Println("CaptureScreen...", bit_map)
|
||||||
gbit_map := robotgo.Capture_Screen()
|
// gbit_map := robotgo.Capture_Screen()
|
||||||
Println("Capture_Screen...", gbit_map.Width)
|
gbitMap := robotgo.BCaptureScreen()
|
||||||
|
Println("Capture_Screen...", gbitMap.Width)
|
||||||
|
|
||||||
sx, sy := robotgo.GetScreenSize()
|
sx, sy := robotgo.GetScreenSize()
|
||||||
//Gets the screen width and height
|
//Gets the screen width and height
|
||||||
@ -72,39 +74,40 @@ func main() {
|
|||||||
Println("color---", color2)
|
Println("color---", color2)
|
||||||
|
|
||||||
// Bitmap
|
// Bitmap
|
||||||
abit_map := robotgo.CaptureScreen()
|
abitMap := robotgo.CaptureScreen()
|
||||||
//Gets all of the screen
|
//Gets all of the screen
|
||||||
Println("a...", abit_map)
|
Println("a...", abitMap)
|
||||||
|
|
||||||
bit_map := robotgo.CaptureScreen(100, 200, 30, 40)
|
bitmap := robotgo.CaptureScreen(100, 200, 30, 40)
|
||||||
//Gets part of the screen
|
//Gets part of the screen
|
||||||
Println("CaptureScreen...", bit_map)
|
Println("CaptureScreen...", bitmap)
|
||||||
// Println("...", bit_map.Width, bit_map.BytesPerPixel)
|
// Println("...", bit_map.Width, bit_map.BytesPerPixel)
|
||||||
|
|
||||||
fx, fy := robotgo.FindBitmap(bit_map)
|
fx, fy := robotgo.FindBitmap(bitmap)
|
||||||
//Searches for needle in bitmap
|
//Searches for needle in bitmap
|
||||||
Println("FindBitmap------", fx, fy)
|
Println("FindBitmap------", fx, fy)
|
||||||
|
|
||||||
bit_pos := robotgo.GetPortion(bit_map, 10, 10, 11, 10)
|
bitpos := robotgo.GetPortion(bitmap, 10, 10, 11, 10)
|
||||||
//Returns new bitmap object created from a portion of another
|
//Returns new bitmap object created from a portion of another
|
||||||
Println(bit_pos)
|
Println(bitpos)
|
||||||
|
|
||||||
bit_str := robotgo.TostringBitmap(bit_map)
|
bitstr := robotgo.TostringBitmap(bitmap)
|
||||||
//Creates bitmap from string by bit_map
|
//Creates bitmap from string by bit_map
|
||||||
Println("bit_str...", bit_str)
|
Println("bit_str...", bitstr)
|
||||||
|
|
||||||
// sbit_map := robotgo.BitmapFromstring(bit_str, 2)
|
// sbit_map := robotgo.BitmapFromstring(bit_str, 2)
|
||||||
// Println("...", sbit_map)
|
// Println("...", sbit_map)
|
||||||
|
|
||||||
robotgo.SaveBitmap(bit_map, "test.png")
|
robotgo.SaveBitmap(bitmap, "test.png")
|
||||||
//Saves image to absolute filepath in the given format
|
//Saves image to absolute filepath in the given format
|
||||||
robotgo.SaveBitmap(bit_map, "test31.tif", 1)
|
robotgo.SaveBitmap(bitmap, "test31.tif", 1)
|
||||||
robotgo.Convert("test.png", "test.tif")
|
robotgo.Convert("test.png", "test.tif")
|
||||||
//Convert image
|
//Convert image
|
||||||
|
|
||||||
open_bit := robotgo.OpenBitmap("test.tif")
|
// open_bit := robotgo.OpenBitmap("test.tif")
|
||||||
|
openbit := robotgo.OpenBitmap("test.tif")
|
||||||
// open image bitmap
|
// open image bitmap
|
||||||
Println("open...", open_bit)
|
Println("open...", openbit)
|
||||||
|
|
||||||
//global event listener
|
//global event listener
|
||||||
Println("---please press v---")
|
Println("---please press v---")
|
||||||
|
Loading…
Reference in New Issue
Block a user