Merge pull request #464 from go-vgo/bitmap-pr

Add image and byte to CBitmap support
This commit is contained in:
Evans 2022-02-08 03:11:19 -08:00 committed by GitHub
commit d14fae83be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)