Load a bmp file into a TSpeedButton

↘锁芯ラ 提交于 2020-04-18 05:45:21

问题


Using Embarcadero C++Builder, does anyone know how to manually load a .bmp file into a TSpeedButton using the Glyph property, setting a path to the image, not with the Object Inspector?


回答1:


The Glyph property is a TBitmap, so you can use the TBitmap::LoadFromFile() method to load a new glyph from a file:

speedbutton->Glyph->LoadFromFile("filename.bmp");

Note: "Glyph can provide up to four images within a single bitmap. All images must be the same size and next to each other in a horizontal row."



来源:https://stackoverflow.com/questions/60153693/load-a-bmp-file-into-a-tspeedbutton

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