mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-30 22:13:54 +00:00
Update freebitmap and rename some c func
This commit is contained in:
parent
fd894c06cb
commit
44578aad48
@ -77,7 +77,7 @@ MMPoint aFindBitmap(MMBitmapRef bit_map, MMRect rect){
|
||||
return point;
|
||||
}
|
||||
|
||||
MMBitmapRef aOpenBitmap(char *path, uint16_t ttype){
|
||||
MMBitmapRef bitmap_open(char *path, uint16_t ttype){
|
||||
// MMImageType type;
|
||||
|
||||
MMBitmapRef bitmap;
|
||||
@ -89,7 +89,7 @@ MMBitmapRef aOpenBitmap(char *path, uint16_t ttype){
|
||||
|
||||
}
|
||||
|
||||
char *aSaveBitmap(MMBitmapRef bitmap, char *path, uint16_t type){
|
||||
char *bitmap_save(MMBitmapRef bitmap, char *path, uint16_t type){
|
||||
if (saveMMBitmapToFile(bitmap, path, (MMImageType) type) != 0) {
|
||||
return "Could not save image to file.";
|
||||
}else{
|
||||
|
@ -589,7 +589,7 @@ func OpenBitmap(args ...interface{}) C.MMBitmapRef {
|
||||
// fmt.Println("err:::", e)
|
||||
mtype = 1
|
||||
})
|
||||
bit := C.aOpenBitmap(path, mtype)
|
||||
bit := C.bitmap_open(path, mtype)
|
||||
defer C.free(unsafe.Pointer(path))
|
||||
// fmt.Println("opening...", bit)
|
||||
return bit
|
||||
@ -607,7 +607,7 @@ func SaveBitmap(args ...interface{}) string {
|
||||
})
|
||||
|
||||
path := C.CString(args[1].(string))
|
||||
savebit := C.aSaveBitmap(args[0].(C.MMBitmapRef), path, mtype)
|
||||
savebit := C.bitmap_save(args[0].(C.MMBitmapRef), path, mtype)
|
||||
// fmt.Println("saved...", savebit)
|
||||
// return bit
|
||||
defer C.free(unsafe.Pointer(path))
|
||||
@ -662,8 +662,9 @@ func Convert(args ...interface{}) {
|
||||
}
|
||||
|
||||
// FreeBitmap free and dealloc bitmap
|
||||
func FreeBitmap(ref C.MMBitmapRef) {
|
||||
C.destroyMMBitmap(ref)
|
||||
func FreeBitmap(bitmap C.MMBitmapRef) {
|
||||
// C.destroyMMBitmap(bitmap)
|
||||
C.bitmap_dealloc(bitmap)
|
||||
}
|
||||
|
||||
// ReadBitmap returns false and sets error if |bitmap| is NULL
|
||||
|
Loading…
Reference in New Issue
Block a user