mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 06:33:56 +00:00
Update bitmap
This commit is contained in:
parent
d520880502
commit
979a569eda
@ -116,7 +116,7 @@ char *bitmap_save(MMBitmapRef bitmap, char *path, uint16_t type){
|
||||
return "ok";
|
||||
}
|
||||
|
||||
char *aTostringBitmap(MMBitmapRef bitmap){
|
||||
char *tostring_Bitmap(MMBitmapRef bitmap){
|
||||
char *buf = NULL;
|
||||
MMBMPStringError err;
|
||||
|
||||
@ -125,7 +125,20 @@ char *aTostringBitmap(MMBitmapRef bitmap){
|
||||
return buf;
|
||||
}
|
||||
|
||||
MMBitmapRef aGetPortion(MMBitmapRef bit_map, MMRect rect){
|
||||
// out with size 200 is enough
|
||||
bool bitmap_str(MMBitmapRef bitmap, char *out){
|
||||
if (!bitmap_ready(bitmap)) return false;
|
||||
sprintf(out, "<Bitmap with resolution %lu%lu, \
|
||||
%u bits per pixel, and %u bytes per pixel>",
|
||||
(unsigned long)bitmap->width,
|
||||
(unsigned long)bitmap->height,
|
||||
bitmap->bitsPerPixel,
|
||||
bitmap->bytesPerPixel);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
MMBitmapRef get_Portion(MMBitmapRef bit_map, MMRect rect){
|
||||
// MMRect rect;
|
||||
MMBitmapRef portion = NULL;
|
||||
|
||||
|
@ -668,7 +668,7 @@ func SaveBitmap(args ...interface{}) string {
|
||||
// TostringBitmap tostring bitmap
|
||||
func TostringBitmap(bit C.MMBitmapRef) *C.char {
|
||||
// str_bit := C.aTostringBitmap(bit)
|
||||
strBit := C.aTostringBitmap(bit)
|
||||
strBit := C.tostring_Bitmap(bit)
|
||||
// fmt.Println("...", str_bit)
|
||||
// return str_bit
|
||||
return strBit
|
||||
@ -682,7 +682,7 @@ func GetPortion(bit C.MMBitmapRef, x, y, w, h C.size_t) C.MMBitmapRef {
|
||||
rect.size.width = w
|
||||
rect.size.height = h
|
||||
|
||||
pos := C.aGetPortion(bit, rect)
|
||||
pos := C.get_Portion(bit, rect)
|
||||
return pos
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user