Uhh yeah im trying to draw a image but i have no idea
ImTextureID my_tex_id = io.Fonts->TexID;
float my_tex_w = (float)io.Fonts->TexWidth;
float my_tex_h = (float)io.Fonts->TexHeight;
ImGui::Image(my_tex_id, ImVec2(my_tex_w, my_tex_h), ImVec2(0, 0), ImVec2(1, 1), ImColor(255, 255, 255, 255), ImColor(255, 255, 255, 128));
Just copy and pasted the example from imgui_demo but how can i change the ImTextureId to a png?
ImTextureID my_tex_id = "D:\DL\_SHIT\xd.JPG";
doesnt work
Turning an image into a graphics textures it out of scope of imgui, it's up to your back end code. Please read about OpenGL / DirectX texture loading, whatever graphics backend you are using. Also please read the documentation about ImTextureId and browse/run the demo window code.
k
I have now written a tutorial to cover image file loading for common graphics API:
https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
Most helpful comment
I have now written a tutorial to cover image file loading for common graphics API:
https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples