Fix GetImageData

This commit is contained in:
Milan Nikolic 2018-05-06 13:48:27 +02:00
parent 680e87e395
commit 759568193c
2 changed files with 19 additions and 16 deletions

View file

@ -1045,18 +1045,6 @@ type Image struct {
Format PixelFormat
}
// ToImage converts a Image to Go image.Image
func (i *Image) ToImage() image.Image {
img := image.NewRGBA(image.Rect(0, 0, int(i.Width), int(i.Height)))
// Get pixel data from image (RGBA 32bit)
pixels := GetImageData(i)
img.Pix = pixels
return img
}
// NewImage - Returns new Image
func NewImage(data []byte, width, height, mipmaps int32, format PixelFormat) *Image {
d := unsafe.Pointer(&data[0])