Closed ankerSlicerTeam closed 1 month ago
This is likely an issue in ImGuiTexInspect
This demo only calls ImGuiTexInspect::ShowDemoWindow():
int main(int, char **)
{
HelloImGui::SetAssetsFolder(DemosAssetsFolder());
HelloImGui::SimpleRunnerParams runnerParams{.guiFunction = ImGuiTexInspect::ShowDemoWindow, .windowSize={1000, 1000}};
ImmApp::AddOnsParams addOnsParams;
addOnsParams.withTexInspect = true;
ImmApp::Run(runnerParams, addOnsParams);
return 0;
}
If you need to get pixel values, I advise you to use ImmVision which you can see in the demo
Thank you for your answer. I have found the reason. imgui_tex_inspect sets a fixed value (512,512) when setting the texture size. However, when the image size is not (512,512), the texture is resized, and then the output rgba result is not displayed as shown after resize. By the way, ImmVision is a great tool and admire your excellent contribution
Thank you for your answer. I have found the reason. imgui_tex_inspect sets a fixed value (512,512) when setting the texture size. However, when the image size is not (512,512), the texture is resized, and then the output rgba result is not displayed as shown after resize. By the way, ImmVision is a great tool and admire your excellent contribution
in imgui_tex_inspect_demo.h line 19:
Texture LoadTexture(const char * path)
{
auto textureId = HelloImGui::ImTextureIdFromAsset(path);
Texture r;
r.size = ImVec2(512.f, 512.f); // This function is only by used the demo, which uses a 512x512 image
r.texture = textureId;
return r;
}
However, the size of demo_tex_inspect.png displayed is 256*256
Ok thanks a lot for letting me know. I updated the code that sets the texture size. See these commits in the ImGuiTexInspect fork and in Dear ImGui Bundle.