Board index » delphi » TImageList bitmaps are gone.

TImageList bitmaps are gone.

Hello all,

I have an application which uses a TimageList to keep the bitmaps
of a Toolbar's buttons. In some computers these bitmaps show up OK
but in some other computers they do not appear on the screen, although,
the buttons are still there, I can see them by moving the mouse over the
toolbar.
Even they execute the functions they  were programed to do.

What is more, there are two similar computers; ONE show the Glyphs and the
OTHER Does not.

Any idea of what could be wrong.

I use Client/Server D4.3

Thanks in advance...
Jose Antonio

 

Re:TImageList bitmaps are gone.


On Tue, 3 Aug 1999 17:45:50 +0200, "Jos Antonio Mesa"

Quote
<ame...@mtas.es> wrote:
>I have an application which uses a TimageList to keep the bitmaps
>of a Toolbar's buttons. In some computers these bitmaps show up OK
>but in some other computers they do not appear on the screen, although,
>the buttons are still there, I can see them by moving the mouse over the
>toolbar.
>Even they execute the functions they  were programed to do.

>What is more, there are two similar computers; ONE show the Glyphs and the
>OTHER Does not.

Make sure that all of the computers (including the one that the
application is developed on) have the latest comctl32.dll installed.
Do this by downloading 401COMUPD.EXE from the Microsoft web site and
running it on all of the machines.

-Steve

Re:TImageList bitmaps are gone.


Thank you Steve for your answer.

I'm not able to change every computer the application will run on, so,
I have investigated a little bit and I have found the following.

1. I've saved the TImageList's bitmaps in a file (at design time)
2. I've tried to load from delphi's Image Editor and it said
    "Image of more than 256 color are not supported"
3. I've loaded into PaintBrush and Save it as (256 Color Bitmap).
4. I replaced the TimageList Bitmaps with this new file and rebuild the
project.

Now EVERY computer shows the Glyphs OK.

So, my question now turns to be:

Is there any way I can use to avoid loading Icon/BMP into a TimageList of
more
than 256?.

Or rather, is there a method where I can change the Bitmap of a Timagelist
at run time
to make it 256 color bitmap?

I have read all (I've been able to find) the Online pages about TImageList
and found no Clues.

Thanks,
Jose

Re:TImageList bitmaps are gone.


On Wed, 4 Aug 1999 20:46:09 +0200, "Jos Antonio Mesa"

Quote
<jam...@databasedm.es> wrote:
>Is there any way I can use to avoid loading Icon/BMP into a TimageList of
>more than 256?.

I'm not sure what you're asking. If the goal is to not have bitmaps
with more than 256 colors in the image list, then the solution is
"Don't put bitmaps having more than 256 colors in the image list."

Quote
>Or rather, is there a method where I can change the Bitmap of a Timagelist
>at run time to make it 256 color bitmap?

That won't solve the problem. You need to make sure that you don't put
"illegal" bitmaps in the image list in the first place. If you have a
bitmap in memory, you can examine (and change) the number of colors
with the PixelFormat property.

-Steve

Re:TImageList bitmaps are gone.


Create a Resource File (.res) with all of the bitmap images you wish to be in
the TimageList and
include this file in your program (ie. {$R MyBmps.res}.
In OnCreate Initialize your TImageList with the images size. then load all of
the images using
ResourceLoad(rtBitmap,'some Name',Transparent Colour); statements. This will
run on the
oldest of CommCtrl.DLL versions.

I make all my images with regular names ie. MyBmp1, MyBmp2, then..

for i:= 1 to N do
  ImageList1.ResourceLoad(rtBitmap,'MyBmp'+IntToStr(i),clTeal);

You may have some problems with ToolBar though.. If so, try a panel with
speedbuttons.

Glenn

Other Threads