将bmp文件加载到TSpeedButton中 [英] Load a bmp file into a TSpeedButton
本文介绍了将bmp文件加载到TSpeedButton中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Embarcadero C ++ Builder,有谁知道如何手动将 .bmp
文件加载到 TSpeedButton
使用字形
属性,设置图像的路径,而不是使用对象检查器?
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?
推荐答案
字形
属性是 TBitmap
,因此您可以使用 TBitmap :: LoadFromFile()
方法从文件中加载新字形:
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."
这篇关于将bmp文件加载到TSpeedButton中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文