mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 06:33:56 +00:00
add bitmap to CBitmap func
This commit is contained in:
parent
d5b24d634b
commit
fdddd73837
14
robotgo.go
14
robotgo.go
@ -807,6 +807,20 @@ func ToBitmap(bit C.MMBitmapRef) Bitmap {
|
||||
return bitmap
|
||||
}
|
||||
|
||||
// ToCBitmap trans Bitmap to C.MMBitmapRef
|
||||
func ToCBitmap(bit Bitmap) C.MMBitmapRef {
|
||||
cbitmap := C.createMMBitmap(
|
||||
(*C.uint8_t)(bit.ImageBuffer),
|
||||
C.size_t(bit.Width),
|
||||
C.size_t(bit.Height),
|
||||
C.size_t(bit.Bytewidth),
|
||||
C.uint8_t(bit.BitsPerPixel),
|
||||
C.uint8_t(bit.BytesPerPixel),
|
||||
)
|
||||
|
||||
return cbitmap
|
||||
}
|
||||
|
||||
// ToMMBitmapRef trans CBitmap to C.MMBitmapRef
|
||||
func ToMMBitmapRef(bit CBitmap) C.MMBitmapRef {
|
||||
return C.MMBitmapRef(bit)
|
||||
|
Loading…
Reference in New Issue
Block a user