NewImage creates and returns an image panel with the image from the specified image used as a texture. Initially the size of the panel content area is the exact size of the image.
(imgfile string)
| 20 | // from the specified image used as a texture. |
| 21 | // Initially the size of the panel content area is the exact size of the image. |
| 22 | func NewImage(imgfile string) (image *Image, err error) { |
| 23 | |
| 24 | tex, err := texture.NewTexture2DFromImage(imgfile) |
| 25 | if err != nil { |
| 26 | return nil, err |
| 27 | } |
| 28 | return NewImageFromTex(tex), nil |
| 29 | } |
| 30 | |
| 31 | // NewImageFromRGBA creates and returns an image panel from the |
| 32 | // specified image |
no test coverage detected