From c8758ab24083f003bfc5bc0405ccbf9f9b57c41b Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sat, 16 Jun 2018 17:41:04 +0800 Subject: [PATCH] add get px destroyMMBitmap and update code style --- screen/goScreen.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/screen/goScreen.h b/screen/goScreen.h index 956cd69..c3cd96d 100644 --- a/screen/goScreen.h +++ b/screen/goScreen.h @@ -23,7 +23,6 @@ void padHex(MMRGBHex color, char* hex){ char* pad_hex(MMRGBHex color){ char hex[7]; padHex(color, hex); - // destroyMMBitmap(bitmap); char* str = (char*)calloc(100, sizeof(char*)); @@ -57,6 +56,7 @@ MMRGBHex get_px_color(size_t x, size_t y){ // bitmap = MMRectMake(x, y, 1, 1); color = MMRGBHexAtPoint(bitmap, 0, 0); + destroyMMBitmap(bitmap); return color; } @@ -76,13 +76,10 @@ char* get_pixel_color(size_t x, size_t y){ color = MMRGBHexAtPoint(bitmap, 0, 0); char hex[7]; - padHex(color, hex); - destroyMMBitmap(bitmap); // printf("%s\n", hex); - // return 0; char* s = (char*)calloc(100, sizeof(char*));