Skip to content

Changing texture sampler / Passing a bigger ImVec2 to AddImage and Image leads to pixel line #7230

@Infiziert90

Description

@Infiziert90

Version/Branch of Dear ImGui:

1.90.2 and before

Back-ends:

Win32 DirectX11

Compiler, OS:

MSVC, Windows 10

Full config/build information:

No response

Details:

Was trying around with AddImage in ImGui.NET and noticed that giving the AddImage/Image functions p_max that exceed the image width/height leads to a 1 pixel line being added on top of it.

This doesn't happen with the exact size or smaller size.

So i tried the same in the DirectX11 example provided for C ImGui and it produces the same result.

Looking through the web for DirectX11 issues with this specific problem, i couldn't find anything, so i wondered if this is ImGui doing something wrong

Screenshots/Video:

The result in the ImGui preview window, very noticeable line above it
ImGuiPreview

And here the used texture for this test
0

Minimal, Complete and Verifiable Example code:

Code from https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples#example-for-directx11-users

        int my_image_width = 0;
        int my_image_height = 0;
        ID3D11ShaderResourceView* my_texture = NULL;
        bool ret = LoadTextureFromFile("0.png", &my_texture, &my_image_width, &my_image_height);
        IM_ASSERT(ret);

        ImGui::PushStyleColor(2, ImVec4(1, 1, 1, 1));
        ImGui::Begin("DirectX11 Texture Test");
        ImGui::Image((void*)my_texture, ImVec2(my_image_width, my_image_height));
        ImGui::SameLine();
        ImGui::Image((void*)my_texture, ImVec2(my_image_width * 2, my_image_height * 2));
        ImGui::End();
        ImGui::PopStyleColor();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions