示例#1
0
文件: gd.go 项目: nate/mogrify-go
func gdCreate(sx, sy int) *gdImage {
	img := img(C.gdImageCreateTrueColor(C.int(sx), C.int(sy)))

	if img == nil {
		return nil
	}

	C.gdImageAlphaBlending(img.img, C.int(cbool(false)))
	C.gdImageSaveAlpha(img.img, C.int(cbool(true)))

	return img
}
示例#2
0
文件: gd.go 项目: trajber/go-gd
func (p *Image) SaveAlpha(saveflag bool) {
	C.gdImageSaveAlpha(p.img, map[bool]C.int{true: 1, false: 0}[saveflag])
}
示例#3
0
文件: gd.go 项目: nate/mogrify-go
func (p *gdImage) gdSaveAlpha(b bool) {
	C.gdImageSaveAlpha(p.img, C.int(cbool(b)))
}