mirror of
https://github.com/go-vgo/robotgo
synced 2026-05-23 17:59:12 +00:00
Merge pull request #464 from go-vgo/bitmap-pr
Add image and byte to CBitmap support
This commit is contained in:
commit
d14fae83be
1 changed files with 11 additions and 0 deletions
11
robotgo.go
11
robotgo.go
|
|
@ -394,6 +394,17 @@ func ToRGBA(bit CBitmap) *image.RGBA {
|
|||
return ToRGBAGo(bmp1)
|
||||
}
|
||||
|
||||
// ImgToCBitmap trans image.Image to CBitmap
|
||||
func ImgToCBitmap(img image.Image) CBitmap {
|
||||
return ToCBitmap(ImgToBitmap(img))
|
||||
}
|
||||
|
||||
// ByteToCBitmap trans []byte to CBitmap
|
||||
func ByteToCBitmap(by []byte) CBitmap {
|
||||
img, _ := ByteToImg(by)
|
||||
return ImgToCBitmap(img)
|
||||
}
|
||||
|
||||
// SetXDisplayName set XDisplay name (Linux)
|
||||
func SetXDisplayName(name string) error {
|
||||
cname := C.CString(name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue