Board index » delphi » Speedbutton Glyphs from TimageList

Speedbutton Glyphs from TimageList

Can you help?

I have some 40 bitmaps that need to be placed on speedbuttons. These
buttons are generated and the image selected for each at runtime.

The buttons are in an array, and at the moment I have to load the
glyphs from  external bitmap files. So I need to distribute some 50
bitmaps, all 30*30 size. It would be far more elegant to store these
bitmaps in an TImageList in the application and call the appropriate
image into the speedbutton on demand at runtime.

But there seems to be no easy way of casting an image into a glyph.

Have you any suggestions ?

Thank You.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading

 

Re:Speedbutton Glyphs from TimageList


ghoo...@my-dejanews.com schrieb in Nachricht
<6jgq3q$j...@nnrp1.dejanews.com>...

Quote
>...
>The buttons are in an array, and at the moment I have to load the
>glyphs from  external bitmap files. So I need to distribute some 50
>bitmaps, all 30*30 size. It would be far more elegant to store these
>bitmaps in an TImageList in the application and call the appropriate
>image into the speedbutton on demand at runtime.

>But there seems to be no easy way of casting an image into a glyph.
>...

What did you try?

How about:
  ImageList.GetBitmap(Index, Bitmap);
  SpeedButton.Glyph.Assign(Bitmap);

Ralf.
--
(Remove no. & .spam from my address.)

Other Threads