Loading image into TImageList?

Loading image into TImageList?

Post by Ken Pawlu » Tue, 07 Nov 2000 04:00:00


I have a bmp that has multiple images in a strip.  What's the best way to
load them into an imagelist?
I've been trying this:

Imagelist1.FileLoad(rtBitmap,'c:\pics\junk.bmp',clMenu);

But if possible I'd like to use the bottom left pixel for transparency.
Should this image be compiled into a resource file?  Any suggestions are
helpful.  Thanks.
Ken

 
 
 

Loading image into TImageList?

Post by Andreas Pawli » Wed, 08 Nov 2000 04:00:00



> Should this image be compiled into a resource file?  Any suggestions > are helpful.

I would add it to a resource file. You can then use

  ImageList.ResourceLoad(rtBitmap, 'MYIMAGE', cl???);

Use ImageList.ResInstLoad instead when loading from a package.
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5


 
 
 

Loading image into TImageList?

Post by Ken Pawlu » Wed, 08 Nov 2000 04:00:00


Thanks.  This works.  I have a couple other questions.
What do people generally use when they want to keep the resources (icons,
images, etc...) separate from the exe and load it only at runtime?  Resource
dll's?  I would like to be able to just supply the customer with a different
"image" file and have the new images load in instead.
Also, besides Resource workshop and image editor are there any other tools
that can create resource files or the like?  Image Editor is very limited
and time consuming to work with IMO (hopefully they update it in D6).
Ken


> I would add it to a resource file. You can then use

>   ImageList.ResourceLoad(rtBitmap, 'MYIMAGE', cl???);

> Use ImageList.ResInstLoad instead when loading from a package.
> ________
> Andreas
> Delphi 5.01 Pro, NT4.0 Sp5


 
 
 

Loading image into TImageList?

Post by Andreas Pawli » Wed, 08 Nov 2000 04:00:00



>What do people generally use when they want to keep the resources  >(icons, images, etc...) separate from the exe and load it only at >runtime?  Resource dll's?  I would like to be able to just supply the >customer with a different "image" file and have the new images load >in instead.
>Also, besides Resource workshop and image editor are there any other >tools that can create resource files or the like?  Image Editor is >very limited and time consuming to work with IMO (hopefully they >update it in D6).

1) Resource DLLs is the way to go IMO.

2) You can always create .rc files and compile them with brcc32.exe
but this is not a practical solution either. Looking for tools, try
these two links

  http://www.wilsonc.demon.co.uk/delphi.htm
  http://rpi.net.au/~ajohnson/resourcehacker

I fully agree that ImageEditor is a tool that urgently needs an
overhaul.
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp5