MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / Image

Method Image

lib/imgui/imgui_widgets.cpp:941–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

939}
940
941void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col)
942{
943 ImGuiWindow* window = GetCurrentWindow();
944 if (window->SkipItems)
945 return;
946
947 ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
948 if (border_col.w > 0.0f)
949 bb.Max += ImVec2(2, 2);
950 ItemSize(bb);
951 if (!ItemAdd(bb, 0))
952 return;
953
954 if (border_col.w > 0.0f)
955 {
956 window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(border_col), 0.0f);
957 window->DrawList->AddImage(user_texture_id, bb.Min + ImVec2(1, 1), bb.Max - ImVec2(1, 1), uv0, uv1, GetColorU32(tint_col));
958 }
959 else
960 {
961 window->DrawList->AddImage(user_texture_id, bb.Min, bb.Max, uv0, uv1, GetColorU32(tint_col));
962 }
963}
964
965// frame_padding < 0: uses FramePadding from style (default)
966// frame_padding = 0: no framing

Callers

nothing calls this directly

Calls 5

GetCurrentWindowFunction · 0.85
ImVec2Class · 0.85
ItemSizeClass · 0.85
AddRectMethod · 0.80
AddImageMethod · 0.80

Tested by

no test coverage detected