Image not showing in TSpeedButton

此生再无相见时 提交于 2020-03-04 15:57:21

问题


I'm working with Embarcadero C++Builder. I'm using the TSpeedButton component with a .bmp image. No matter what format I try, everything looks great in the IDE, but when I compile and generate the .exe file and then start the application, there are no images. There is the text with a small white square on the TSpeedButton. I have tried the .png, .jpg, .bmp, .ico formats. Is there any solution to my issue?.


回答1:


TSpeedButton has property NumGlyphs which indicates how many images Glyph contains. If you have only one image, then set NumGlyphs = 1.

Additionally, you can have separate images for disabled, hovered and pressed (down) buttons. In that case, multiple images are stored on the same bitmap next to each other in a horizontal raw; every image must have the same size. For instance, a bitmap 128x32px provides 4 images, 32x32px each.

Worth of mention that the bottom-left pixel indicates the transparent color, i.e., pixels of that color do not get drawn.




回答2:


I have find the solution of my issue. it was just a problem of compatibility mode applied by default by windows 10. I have just disabled the running of the application under compatibility mode Win XP SP2 and then no showing issue.

Thanks for all your support.



来源:https://stackoverflow.com/questions/60151358/image-not-showing-in-tspeedbutton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!