update and fmt code style

This commit is contained in:
vcaesar 2018-05-06 18:04:31 +08:00
parent 728b1d520a
commit 5e6a6187de
2 changed files with 4 additions and 5 deletions

View File

@ -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)

View File

@ -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;
}