示例#1
0
文件: text.go 项目: gtalent/starfish
func (me *Text) Free() {
	b.FreeImage(me.text)
}
示例#2
0
文件: image.go 项目: gtalent/starfish
		} else {
			w = key.Width
		}
		if key.Height == -1 {
			h = int(i.H())
		} else {
			h = key.Height
		}
		if (i != nil) && (w != int(i.W()) || h != int(i.H()) || key.Angle != 0) {
			i = p.ResizeAngleOf(i, key.Angle, w, h)
		}
		return i
	},
	func(me *flyweight, path key, img interface{}) {
		i := img.(*p.Image)
		p.FreeImage(i)
	})

type Image struct {
	img     *p.Image
	key     imageKey
	size    starfish.Size
	srcBnds starfish.Bounds
}

//Loads the image at the given path, or nil if the image was not found.
func LoadImage(path string) *Image {
	return LoadImageSize(path, -1, -1)
}

//Loads the image at the given path at the given angle, or nil if the image was not found.