Esempio n. 1
0
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
}
Esempio n. 2
0
File: gd.go Progetto: trajber/go-gd
func (p *Image) AlphaBlending(blendmode bool) {
	C.gdImageAlphaBlending(p.img, map[bool]C.int{true: 1, false: 0}[blendmode])
}
Esempio n. 3
0
func (p *gdImage) gdAlphaBlending(b bool) {
	C.gdImageAlphaBlending(p.img, C.int(cbool(b)))
}