mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-06 08:43:56 +00:00
Clean Println and Add return
This commit is contained in:
parent
2395bb3f5a
commit
f927b52279
@ -31,7 +31,6 @@ import "C"
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
// . "fmt"
|
// . "fmt"
|
||||||
"fmt"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
// "runtime"
|
// "runtime"
|
||||||
@ -542,7 +541,7 @@ func OpenBitmap(args ...interface{}) C.MMBitmapRef {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//SaveBitmap Save the Bitmap
|
//SaveBitmap Save the Bitmap
|
||||||
func SaveBitmap(args ...interface{}) {
|
func SaveBitmap(args ...interface{}) string {
|
||||||
var mtype C.uint16_t
|
var mtype C.uint16_t
|
||||||
Try(func() {
|
Try(func() {
|
||||||
mtype = C.uint16_t(args[2].(int))
|
mtype = C.uint16_t(args[2].(int))
|
||||||
@ -553,9 +552,11 @@ func SaveBitmap(args ...interface{}) {
|
|||||||
|
|
||||||
path := C.CString(args[1].(string))
|
path := C.CString(args[1].(string))
|
||||||
savebit := C.aSaveBitmap(args[0].(C.MMBitmapRef), path, mtype)
|
savebit := C.aSaveBitmap(args[0].(C.MMBitmapRef), path, mtype)
|
||||||
fmt.Println("saved...", savebit)
|
// fmt.Println("saved...", savebit)
|
||||||
// return bit
|
// return bit
|
||||||
// defer C.free(unsafe.Pointer(path))
|
// defer C.free(unsafe.Pointer(path))
|
||||||
|
|
||||||
|
return C.GoString(savebit)
|
||||||
}
|
}
|
||||||
|
|
||||||
// func SaveBitmap(bit C.MMBitmapRef, gpath string, mtype C.MMImageType) {
|
// func SaveBitmap(bit C.MMBitmapRef, gpath string, mtype C.MMImageType) {
|
||||||
@ -593,7 +594,7 @@ func Convert(args ...interface{}) {
|
|||||||
Try(func() {
|
Try(func() {
|
||||||
mtype = args[2].(int)
|
mtype = args[2].(int)
|
||||||
}, func(e interface{}) {
|
}, func(e interface{}) {
|
||||||
fmt.Println("err:::", e)
|
// fmt.Println("err:::", e)
|
||||||
mtype = 1
|
mtype = 1
|
||||||
})
|
})
|
||||||
//C.CString()
|
//C.CString()
|
||||||
|
Loading…
Reference in New Issue
Block a user