mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-06 06:25:54 +01:00
Added images
parent
ba7f3d0a0a
commit
8fec7ca088
@ -279,7 +279,10 @@ ImVec2 uv1 = ImVec2((10.0f+100.0f)/256.0f, (10.0f+200.0f)/256.0f);
|
||||
ImGui::Image((void*)texture, ImVec2(100.0f, 100.0f), uv0, uv1);
|
||||
```
|
||||
|
||||

|
||||
|
||||
You can look up "texture coordinates" from other resources such as your favorite search engine, or graphics tutorials.
|
||||
Tip: map your UV coordinates to widgets (using `SliderFloat2` or `DragFloat2`) so you can manipulate them in real-time and better understand the meaning of those values.
|
||||
|
||||
If you want to display the same image but scaled, keep the same UV coordinates but alter the Size:
|
||||
|
||||
@ -290,3 +293,5 @@ ImGui::Image((void*)texture, ImVec2(texture->Width, texture->Height), ImVec2(0.0
|
||||
// Half size, same contents
|
||||
ImGui::Image((void*)texture, ImVec2(texture->Width*0.5f, texture->Height*0.5f), ImVec2(0.0f, 0.0f), ImVec2(1.0f, 1.0f));
|
||||
```
|
||||
|
||||

|
||||
Loading…
x
Reference in New Issue
Block a user