MCPcopy
hub / github.com/g3n/engine / NewImage

Function NewImage

gui/image.go:22–29  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
22func 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

Callers 4

SetImageFromFileMethod · 0.85
buildImagePanelFunction · 0.85
SetImageMethod · 0.85
SetImageMethod · 0.85

Calls 2

NewTexture2DFromImageFunction · 0.92
NewImageFromTexFunction · 0.85

Tested by

no test coverage detected