Add image and byte to CBitmap support

This commit is contained in:
vcaesar 2022-02-08 03:09:26 -08:00
parent a9d995fdf6
commit 8aa3348a2a

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)