From fd894c06cb0a52697c5db0c613ce6de58a508239 Mon Sep 17 00:00:00 2001 From: vCaesar Date: Thu, 29 Jun 2017 22:50:53 +0800 Subject: [PATCH] Add more copy bitmap --- bitmap/goBitmap.h | 4 ++++ robotgo.go | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/bitmap/goBitmap.h b/bitmap/goBitmap.h index 66ea9c8..f50bab2 100644 --- a/bitmap/goBitmap.h +++ b/bitmap/goBitmap.h @@ -54,6 +54,10 @@ bool bitmap_copy_to_pboard(MMBitmapRef bitmap){ return true; } +MMBitmapRef bitmap_deepcopy(MMBitmapRef bitmap){ + return bitmap == NULL ? NULL : copyMMBitmap(bitmap); +} + MMPoint aFindBitmap(MMBitmapRef bit_map, MMRect rect){ // MMRect rect; // rect.size.width = 10; diff --git a/robotgo.go b/robotgo.go index e2b1554..59859df 100644 --- a/robotgo.go +++ b/robotgo.go @@ -680,6 +680,12 @@ func CopyBitpb(bitmap C.MMBitmapRef) bool { return gbool } +// DeepCopyBit deep copy bitmap +func DeepCopyBit(bitmap C.MMBitmapRef) C.MMBitmapRef { + bit := C.bitmap_deepcopy(bitmap) + return bit +} + /* ___________ ____ _______ .__ __. .___________. | ____\ \ / / | ____|| \ | | | |