Fix GetImageData
This commit is contained in:
parent
680e87e395
commit
759568193c
2 changed files with 19 additions and 16 deletions
|
@ -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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue