Creating images #343
Replies: 5 comments 7 replies
-
Images are going to be textures that you will have to load with your rendering backend like OpenGL via glium or whatnot. You can then pass them to egui via something like https://docs.rs/egui/0.11.0/egui/widgets/struct.Image.html or do the rendering yourself by reserving the space ahead-of-time and drawing it yourself. |
Beta Was this translation helpful? Give feedback.
-
I am new to this, so are there examples to load any type of image and load it to egui? |
Beta Was this translation helpful? Give feedback.
-
I would like to know about there is an easy way |
Beta Was this translation helpful? Give feedback.
-
Alright so maybe I'm just terrible at reading Rust documentation but I never found a satisfactory answer of "Here's a barebones basic implementation to get an image to the screen" answer. After spending hours and hours on this I have an answer for other Rust beginners who have absolutely no clue what they are doing (like myself!) I add my images by keeping them in memory in
Then I followed the documentation instructions, but modified the function for easier use:
Then using the
Then back in
Maybe others can point out things I've done wrong - but I FINALLY have an image loading in my application. I'm hoping this helps others who are struggling as much as I was. |
Beta Was this translation helpful? Give feedback.
-
Since egui 0.17.0, there is now a crate |
Beta Was this translation helpful? Give feedback.
-
Is there an easy way to load images or an explanation on how to do it? It's not quite self explanatory as the documentation about text, labels and buttons. Or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions