TImageList dumb question

TImageList dumb question

Post by J. Clark » Fri, 04 Jul 2003 23:43:18



In D7 I'm trying to dynamically load a TImageList with TBitMaps.  If I do it
from a TImage this works:

    ilIndex := ImageList1.Add( Image1.Picture.Bitmap, Nil );

However from an (existing) TBitMap I get an error 'Cannot assign a TBitMap
to a TBitMap' here's my code:

    ilIndex := ImageList1.Add( ABitMap, Nil );

What am I doing wrong?

Thanks
Jeff

 
 
 

TImageList dumb question

Post by Lord Cr » Sat, 05 Jul 2003 00:06:31


On Thu, 3 Jul 2003 10:43:18 -0400, "J. Clarke"


>However from an (existing) TBitMap I get an error 'Cannot assign a TBitMap
>to a TBitMap' here's my code:

>    ilIndex := ImageList1.Add( ABitMap, Nil );

>What am I doing wrong?

Only thing i can think of is that ABitMap is of the Windows.TBitmap
type, which is way different from the Graphics.TBitmap type.

Make sure you're using the TBitmap defined in graphics.pas for ABitMap

- Asbj?rn