mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
update and fmt code style
This commit is contained in:
parent
728b1d520a
commit
5e6a6187de
@ -223,12 +223,12 @@ func CaptureScreen(args ...int) C.MMBitmapRef {
|
|||||||
h C.size_t
|
h C.size_t
|
||||||
)
|
)
|
||||||
|
|
||||||
Try(func() {
|
if len(args) > 3 {
|
||||||
x = C.size_t(args[0])
|
x = C.size_t(args[0])
|
||||||
y = C.size_t(args[1])
|
y = C.size_t(args[1])
|
||||||
w = C.size_t(args[2])
|
w = C.size_t(args[2])
|
||||||
h = C.size_t(args[3])
|
h = C.size_t(args[3])
|
||||||
}, func(e interface{}) {
|
} else {
|
||||||
// fmt.Println("err:::", e)
|
// fmt.Println("err:::", e)
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 0
|
||||||
@ -237,7 +237,7 @@ func CaptureScreen(args ...int) C.MMBitmapRef {
|
|||||||
displaySize = C.getMainDisplaySize()
|
displaySize = C.getMainDisplaySize()
|
||||||
w = displaySize.width
|
w = displaySize.width
|
||||||
h = displaySize.height
|
h = displaySize.height
|
||||||
})
|
}
|
||||||
|
|
||||||
bit := C.capture_screen(x, y, w, h)
|
bit := C.capture_screen(x, y, w, h)
|
||||||
// fmt.Println("...", bit.width)
|
// fmt.Println("...", bit.width)
|
||||||
|
@ -92,7 +92,7 @@ char* get_pixel_color(size_t x, size_t y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
MMSize get_screen_size(){
|
MMSize get_screen_size(){
|
||||||
//Get display size.
|
// Get display size.
|
||||||
MMSize displaySize = getMainDisplaySize();
|
MMSize displaySize = getMainDisplaySize();
|
||||||
return displaySize;
|
return displaySize;
|
||||||
}
|
}
|
||||||
@ -131,7 +131,6 @@ MMBitmapRef capture_screen(size_t x, size_t y, size_t w, size_t h){
|
|||||||
|
|
||||||
MMBitmapRef bitmap = copyMMBitmapFromDisplayInRect(MMRectMake(x, y, w, h));
|
MMBitmapRef bitmap = copyMMBitmapFromDisplayInRect(MMRectMake(x, y, w, h));
|
||||||
// printf("%s\n", bitmap);
|
// printf("%s\n", bitmap);
|
||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user