-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImGui::ImageButton render transparent image error #8165
Comments
Could be many things, you left out so much information that there is nothing to go on. First you can check the texture format and the blend states with RenderDoc, to see if they are as they should be. |
ImageButton() draws a background frame using the ImGuiCol_ButtonXXXX colors. |
So if you have a transparent image and want to disable that background you may need to use: PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0, 0, 0, 0));
PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0, 0, 0, 0));
ImageButton(...);
PopStyleColor(3); You may wrap this into your own helper function if needed. I am adding comments to clarify this in the Closing. |
Version/Branch of Dear ImGui:
Version 1.XX, Branch: XXX (master/docking/etc.)
Back-ends:
imgui_impl_XXX.cpp + imgui_impl_XXX.cpp
Compiler, OS:
GLESv2
Full config/build information:
No response
Details:
ImGui::Image(texid, ImVec2(128, 128), uv0, uv1);
if (ImGui::ImageButton(texid, ImVec2(128, 128))) {
printf("btn clicked!12!!\n");
}
ImGui::Image is right, but imagebutton color is wrong, the edge of "p" image is transparent.
how to solve it , thanks!!!
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: