mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
add get px destroyMMBitmap and update code style
This commit is contained in:
parent
28c7ccf563
commit
c8758ab240
@ -23,7 +23,6 @@ void padHex(MMRGBHex color, char* hex){
|
|||||||
char* pad_hex(MMRGBHex color){
|
char* pad_hex(MMRGBHex color){
|
||||||
char hex[7];
|
char hex[7];
|
||||||
padHex(color, hex);
|
padHex(color, hex);
|
||||||
|
|
||||||
// destroyMMBitmap(bitmap);
|
// destroyMMBitmap(bitmap);
|
||||||
|
|
||||||
char* str = (char*)calloc(100, sizeof(char*));
|
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);
|
// bitmap = MMRectMake(x, y, 1, 1);
|
||||||
|
|
||||||
color = MMRGBHexAtPoint(bitmap, 0, 0);
|
color = MMRGBHexAtPoint(bitmap, 0, 0);
|
||||||
|
destroyMMBitmap(bitmap);
|
||||||
|
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
@ -76,13 +76,10 @@ char* get_pixel_color(size_t x, size_t y){
|
|||||||
color = MMRGBHexAtPoint(bitmap, 0, 0);
|
color = MMRGBHexAtPoint(bitmap, 0, 0);
|
||||||
|
|
||||||
char hex[7];
|
char hex[7];
|
||||||
|
|
||||||
padHex(color, hex);
|
padHex(color, hex);
|
||||||
|
|
||||||
destroyMMBitmap(bitmap);
|
destroyMMBitmap(bitmap);
|
||||||
|
|
||||||
// printf("%s\n", hex);
|
// printf("%s\n", hex);
|
||||||
|
|
||||||
// return 0;
|
// return 0;
|
||||||
|
|
||||||
char* s = (char*)calloc(100, sizeof(char*));
|
char* s = (char*)calloc(100, sizeof(char*));
|
||||||
|
Loading…
Reference in New Issue
Block a user