mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
update savebitmap code
This commit is contained in:
parent
974dbcfc15
commit
dd31f29ad5
10
robotgo.go
10
robotgo.go
@ -1017,14 +1017,14 @@ func BitmapStr(str string) C.MMBitmapRef {
|
|||||||
|
|
||||||
// SaveBitmap save the bitmap to image
|
// SaveBitmap save the bitmap to image
|
||||||
// robotgo.SaveBimap(bitmap C.MMBitmapRef, path string, type int)
|
// robotgo.SaveBimap(bitmap C.MMBitmapRef, path string, type int)
|
||||||
func SaveBitmap(args ...interface{}) string {
|
func SaveBitmap(bitmap C.MMBitmapRef, gpath string, args ...interface{}) string {
|
||||||
var mtype C.uint16_t = 1
|
var mtype C.uint16_t = 1
|
||||||
if len(args) > 2 {
|
if len(args) > 0 {
|
||||||
mtype = C.uint16_t(args[2].(int))
|
mtype = C.uint16_t(args[0].(int))
|
||||||
}
|
}
|
||||||
|
|
||||||
path := C.CString(args[1].(string))
|
path := C.CString(gpath)
|
||||||
saveBit := C.bitmap_save(args[0].(C.MMBitmapRef), path, mtype)
|
saveBit := C.bitmap_save(bitmap, 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))
|
||||||
|
Loading…
Reference in New Issue
Block a user