Update md and docs

This commit is contained in:
vCaesar 2017-01-24 23:27:47 +08:00
parent 8f911409b1
commit edd2416ac6
3 changed files with 35 additions and 33 deletions

View File

@ -17,7 +17,7 @@ RobotGo supports Mac, Windows, and Linux(X11).
This is a work in progress. This is a work in progress.
##Contents ##Contents
- [API Docs](#API-Docs) - [Docs](#docs)
- [Requirements](#requirements) - [Requirements](#requirements)
- [Installation](#installation) - [Installation](#installation)
- [Update](#update) - [Update](#update)
@ -25,11 +25,9 @@ This is a work in progress.
- [Future](#future) - [Future](#future)
- [Contributors](#contributors) - [Contributors](#contributors)
##API-Docs ##Docs
[API Document](https://github.com/go-vgo/robotgo/blob/master/docs/doc.md)    [中文文档](https://github.com/go-vgo/robotgo/blob/master/docs/doc_zh.md) [API Document](https://github.com/go-vgo/robotgo/blob/master/docs/doc.md)    [中文文档](https://github.com/go-vgo/robotgo/blob/master/docs/doc_zh.md)
This is a work in progress.
##Requirements: ##Requirements:
@ -38,7 +36,7 @@ Now,Please make sure Golang,GCC,zlib and libpng is installed correctly before in
###ALL: ###ALL:
``` ```
Golang Golang
Gcc GCC
zlib & libpng (bitmap) zlib & libpng (bitmap)
``` ```
###For Mac OS X: ###For Mac OS X:
@ -163,13 +161,13 @@ import (
) )
func main() { func main() {
bit_map := robotgo.CaptureScreen(10, 20, 30, 40) bitmap := robotgo.CaptureScreen(10, 20, 30, 40)
fmt.Println("...", bit_map) fmt.Println("...", bitmap)
fx, fy := robotgo.FindBitmap(bit_map) fx, fy := robotgo.FindBitmap(bitmap)
fmt.Println("FindBitmap------", fx, fy) fmt.Println("FindBitmap------", fx, fy)
robotgo.SaveBitmap(bit_map, "test.png") robotgo.SaveBitmap(bitmap, "test.png")
} }
``` ```

View File

@ -13,10 +13,8 @@ RobotGo 支持 Mac, Windows, and Linux(X11).
提Issues请到[Github](https://github.com/go-vgo/robotgo),便于统一管理和即时更新 提Issues请到[Github](https://github.com/go-vgo/robotgo),便于统一管理和即时更新
##Contents
##[中文文档](https://github.com/go-vgo/robotgo/blob/master/docs/doc_zh.md)   [API Document](https://github.com/go-vgo/robotgo/blob/master/docs/doc.md) - [Docs](#docs)
英文文档请点击API Document.
- [Requirements](#requirements) - [Requirements](#requirements)
- [Installation](#installation) - [Installation](#installation)
- [Update](#update) - [Update](#update)
@ -24,13 +22,19 @@ RobotGo 支持 Mac, Windows, and Linux(X11).
- [Future](#future) - [Future](#future)
- [Contributors](#contributors) - [Contributors](#contributors)
###Requirements: ##Docs
[中文文档](https://github.com/go-vgo/robotgo/blob/master/docs/doc_zh.md)   [API Document](https://github.com/go-vgo/robotgo/blob/master/docs/doc.md)
英文文档请点击API Document.
##Requirements:
(环境要求) (环境要求)
请在安装RobotGo之前,确保Golang、GCC、zlib和libpng被正确安装
####ALL: ####ALL:
``` ```
Golang Golang
//Gcc GCC
zlib & libpng (bitmap) zlib & libpng (bitmap)
``` ```
####For Mac OS X: ####For Mac OS X:
@ -129,16 +133,16 @@ func main() {
package main package main
import ( import (
. "fmt" "fmt"
"github.com/go-vgo/robotgo" "github.com/go-vgo/robotgo"
) )
func main() { func main() {
x, y := robotgo.GetMousePos() x, y := robotgo.GetMousePos()
Println("pos:", x, y) fmt.Println("pos:", x, y)
color := robotgo.GetPixelColor(100, 200) color := robotgo.GetPixelColor(100, 200)
Println("color----", color) fmt.Println("color----", color)
} }
``` ```
@ -148,19 +152,19 @@ func main() {
package main package main
import ( import (
. "fmt" "fmt"
"github.com/go-vgo/robotgo" "github.com/go-vgo/robotgo"
) )
func main() { func main() {
bit_map := robotgo.CaptureScreen(10, 20, 30, 40) bitmap := robotgo.CaptureScreen(10, 20, 30, 40)
Println("...", bit_map) fmt.Println("...", bitmap)
fx, fy := robotgo.FindBitmap(bit_map) fx, fy := robotgo.FindBitmap(bitmap)
Println("FindBitmap------", fx, fy) fmt.Println("FindBitmap------", fx, fy)
robotgo.SaveBitmap(bit_map, "test.png") robotgo.SaveBitmap(bitmap, "test.png")
} }
``` ```
@ -170,7 +174,7 @@ func main() {
package main package main
import ( import (
. "fmt" "fmt"
"github.com/go-vgo/robotgo" "github.com/go-vgo/robotgo"
) )
@ -178,12 +182,12 @@ import (
func main() { func main() {
keve := robotgo.AddEvent("k") keve := robotgo.AddEvent("k")
if keve == 0 { if keve == 0 {
Println("you press...", "k") fmt.Println("you press...", "k")
} }
mleft := robotgo.AddEvent("mleft") mleft := robotgo.AddEvent("mleft")
if mleft == 0 { if mleft == 0 {
Println("you press...", "mouse left button") fmt.Println("you press...", "mouse left button")
} }
} }
``` ```
@ -193,7 +197,7 @@ func main() {
package main package main
import ( import (
. "fmt" "fmt"
"github.com/go-vgo/robotgo" "github.com/go-vgo/robotgo"
) )
@ -201,11 +205,11 @@ import (
func main() { func main() {
abool := robotgo.ShowAlert("test", "robotgo") abool := robotgo.ShowAlert("test", "robotgo")
if abool == 0 { if abool == 0 {
Println("ok@@@", "ok") fmt.Println("ok@@@", "ok")
} }
title := robotgo.GetTitle() title := robotgo.GetTitle()
Println("title@@@", title) fmt.Println("title@@@", title)
} }
``` ```

View File

@ -508,7 +508,7 @@ func main() {
获取当前窗口 获取当前窗口
####参数: ####参数:
####返回值: ####返回值:
Returns hwnd Returns hwnd
@ -528,7 +528,7 @@ func main() {
获取窗口 Handle 获取窗口 Handle
####参数: ####参数:
####返回值: ####返回值:
Returns hwnd Returns hwnd
@ -548,7 +548,7 @@ func main() {
获取进程id 获取进程id
####参数: ####参数:
####返回值: ####返回值:
返回进程id 返回进程id