S or /

SourceEnum ImageSource

from egui import ImageSource
class ImageSource:

This type tells the Ui how to load an image.

This is used by Image() and Ui.image.

Methods§

@staticmethod def Bytes(uri: str, bytes: Bytes) -> ImageSource§
@staticmethod def Texture(texture: SizedTexture) -> ImageSource§
@staticmethod def Uri(uri: str) -> ImageSource§
def kind_name(self, /) -> str§
Sourcedef load(self, /, ctx: Context, texture_options: TextureOptions, size_hint: SizeHint) -> TexturePoll§

Errors

Failure to load the texture.

Sourcedef texture_size(self, /) -> Vec2 |None§

Size of the texture, if known.

Sourcedef uri(self, /) -> str |None§

Get the uri that this image was constructed from.

This will return None for egui.ImageSource.Texture.