问题
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