mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
add more examples
This commit is contained in:
parent
98daa9a2af
commit
51999a0fa9
@ -90,6 +90,11 @@ func main() {
|
||||
byt := robotgo.OpenImg("test.png")
|
||||
imgo.Save("test2.png", byt)
|
||||
|
||||
w, h := robotgo.GetImgSize("test.png")
|
||||
fmt.Println("image width and hight ", w, h)
|
||||
w, h = imgo.GetSize("test.png")
|
||||
fmt.Println("image width and hight ", w, h)
|
||||
|
||||
// convert image
|
||||
robotgo.Convert("test.png", "test.tif")
|
||||
|
||||
|
@ -26,11 +26,15 @@ func main() {
|
||||
robotgo.TypeString("Hello World")
|
||||
|
||||
robotgo.TypeString("留给真爱你的人")
|
||||
robotgo.MicroSleep(1)
|
||||
|
||||
robotgo.TypeStr("所以, 你好, 再见")
|
||||
robotgo.Sleep(1)
|
||||
|
||||
ustr := uint32(robotgo.CharCodeAt("所以, 你好, 再见", 0))
|
||||
robotgo.UnicodeType(ustr)
|
||||
|
||||
robotgo.PasteStr("粘贴字符串, paste")
|
||||
robotgo.PasteStr(" 粘贴字符串, paste")
|
||||
|
||||
// press "enter"
|
||||
robotgo.KeyTap("enter")
|
||||
|
@ -28,11 +28,15 @@ func key() {
|
||||
robotgo.TypeString("Hello World")
|
||||
|
||||
robotgo.TypeString("留给真爱你的人")
|
||||
robotgo.MicroSleep(1)
|
||||
|
||||
robotgo.TypeStr("所以, 你好, 再见")
|
||||
robotgo.Sleep(1)
|
||||
|
||||
ustr := uint32(robotgo.CharCodeAt("所以, 你好, 再见", 0))
|
||||
robotgo.UnicodeType(ustr)
|
||||
|
||||
robotgo.PasteStr("粘贴字符串, paste")
|
||||
robotgo.PasteStr(" 粘贴字符串, paste")
|
||||
|
||||
// press "enter"
|
||||
robotgo.KeyTap("enter")
|
||||
@ -230,6 +234,11 @@ func bitmap() {
|
||||
byt := robotgo.OpenImg("test.png")
|
||||
imgo.Save("test2.png", byt)
|
||||
|
||||
w, h := robotgo.GetImgSize("test.png")
|
||||
fmt.Println("image width and hight ", w, h)
|
||||
w, h = imgo.GetSize("test.png")
|
||||
fmt.Println("image width and hight ", w, h)
|
||||
|
||||
// convert image
|
||||
robotgo.Convert("test.png", "test.tif")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user