MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / Image

Method Image

KBotExt/imgui/imgui_widgets.cpp:1008–1030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006}
1007
1008void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col)
1009{
1010 ImGuiWindow* window = GetCurrentWindow();
1011 if (window->SkipItems)
1012 return;
1013
1014 ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
1015 if (border_col.w > 0.0f)
1016 bb.Max += ImVec2(2, 2);
1017 ItemSize(bb);
1018 if (!ItemAdd(bb, 0))
1019 return;
1020
1021 if (border_col.w > 0.0f)
1022 {
1023 window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f);
1024 window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col));
1025 }
1026 else
1027 {
1028 window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col));
1029 }
1030}
1031
1032// ImageButton() is flawed as 'id' is always derived from 'texture_id' (see #2464 #1390)
1033// We provide this internal helper to write your own variant while we figure out how to redesign the public ImageButton() API.

Callers

nothing calls this directly

Calls 5

GetCurrentWindowFunction · 0.85
ImVec2Function · 0.85
ItemSizeFunction · 0.85
AddRectMethod · 0.80
AddImageMethod · 0.80

Tested by

no test coverage detected