mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13: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
|
||||
)
|
||||
|
||||
Try(func() {
|
||||
if len(args) > 3 {
|
||||
x = C.size_t(args[0])
|
||||
y = C.size_t(args[1])
|
||||
w = C.size_t(args[2])
|
||||
h = C.size_t(args[3])
|
||||
}, func(e interface{}) {
|
||||
} else {
|
||||
// fmt.Println("err:::", e)
|
||||
x = 0
|
||||
y = 0
|
||||
@ -237,7 +237,7 @@ func CaptureScreen(args ...int) C.MMBitmapRef {
|
||||
displaySize = C.getMainDisplaySize()
|
||||
w = displaySize.width
|
||||
h = displaySize.height
|
||||
})
|
||||
}
|
||||
|
||||
bit := C.capture_screen(x, y, w, h)
|
||||
// fmt.Println("...", bit.width)
|
||||
|
@ -92,7 +92,7 @@ char* get_pixel_color(size_t x, size_t y){
|
||||
}
|
||||
|
||||
MMSize get_screen_size(){
|
||||
//Get display size.
|
||||
// Get display size.
|
||||
MMSize displaySize = getMainDisplaySize();
|
||||
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));
|
||||
// printf("%s\n", bitmap);
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user