Problems with TImageList

Problems with TImageList

Post by Nathan Tesk » Sun, 15 Nov 1998 04:00:00



I don't know if i'm doing something horribly wrong here, or what, but i'm
having some serious issues with TImageList.

I'm trying to set up several ImageLists for the icons in a TTreeView and
TListView.  When i add the images to the imagelist, they look fine in the
window.  They usually look OK at design-time.  When i run the program,
there's horrible black splotchy-ness all around the images (this is for 256
color images).  If i use true color images, there are just holes in the
images.  The really odd thing is, this situation rapidly gets worse, for no
apparent reason, until all the images in my image lists are completely
corrupt, and i have to clear them (at design-time) and re-load all the
images.

Any help anyone can give on this would be greatly appreciated..

-- nathan teske

 
 
 

Problems with TImageList

Post by Nathan Tesk » Sun, 15 Nov 1998 04:00:00


Okay, it seems i get this same behavior sometimes in the glyph of my
speedbutton.. if the bitmap is fairly small, the transparency doesn't work
very well, and the glyph has a tv-noise looking whiteish background..

any ideas?  I'm using windows98, by the way.

nathan teske


>I don't know if i'm doing something horribly wrong here, or what, but i'm
>having some serious issues with TImageList.

>I'm trying to set up several ImageLists for the icons in a TTreeView and
>TListView.  When i add the images to the imagelist, they look fine in the
>window.  They usually look OK at design-time.  When i run the program,
>there's horrible black splotchy-ness all around the images (this is for 256
>color images).  If i use true color images, there are just holes in the
>images.  The really odd thing is, this situation rapidly gets worse, for no
>apparent reason, until all the images in my image lists are completely
>corrupt, and i have to clear them (at design-time) and re-load all the
>images.

>Any help anyone can give on this would be greatly appreciated..

>-- nathan teske


 
 
 

Problems with TImageList

Post by Team » Sun, 15 Nov 1998 04:00:00


Just a guess: It could be a video card issue. See if your video card
settings have a bitmap caching option. If so, turn it off.

--
Kent (TeamB and TurboPower Software)

 
 
 

Problems with TImageList

Post by Nathan Tesk » Mon, 16 Nov 1998 04:00:00


I couldn't find that option anywher ein my display settings... is this an
issue that will rise on other systems, too?  Or is it just because my
computer is screwing up the bitmaps at design-time?  I noticed there was a
similar post in .vcl, so i'm not entirely alone with this problem.. i've got
a pretty run-of-the-mill gateway cow, with a fairly fresh install of windows
98, so i'd be somewhat suprised (and a little worried) if this were entirely
due to my computer...

nathan teske


>Just a guess: It could be a video card issue. See if your video card
>settings have a bitmap caching option. If so, turn it off.

>--
>Kent (TeamB and TurboPower Software)

 
 
 

1. Strange problem with TImageList

Please consider the following code.

__fastcall TMyForm::TMyForm(TComponent* Owner)
  : TForm(Owner)
{
  Graphics::TBitmap *bmp1;
  bmp1 = new  Graphics::TBitmap;
  bmp1->Width = Screen->Width;
  bmp1->Height = Screen->Height;
  MyImage->Picture->Bitmap = bmp1;
  MyScrollBox->Align = alClient;
  maxNDX = 2;
  curBmpNDX = 0;
  MyImageList->Add(bmp1,NULL);
  MyImageList->GetBitmap(0,MyImage->Picture->Bitmap);
If I comment out the last line, all works as I expected, with an image the
size of my screen.  I have a draw function, executed from a command, so that
each time it is pressed, an ellipse is drawn in a random colour at a random
position with a random size.

The problem is that with the last line active, however, the image is a
square scarcely a third of a centimetre across.  Why would TImageList shrink
the bitmap so much?

The autosize property of the TImage component is set to true.  I require the
TImage to grow to the size of the bitmap.  And when I get to managing a list
of bitmaps (there will be 36, no less, no more), they will all be the same
size.

Would I be better off using an STL vector handled pointers to the bitmaps,
and putting code in the form's destructor to delete the bitmaps?

Are TBitmaps reference counted so I can safely use an assignment like

MyImage->Picture->Bitmap = bmps[i]

And subsequently draw to bmps[i].  And if so, is what I draw shown by the
Image it it's bitmap property is currently set to bmps[i], or do I have to
repeat the assignment?  I would suppose the smartest approach is to draw to
the bmps elements before they are shown.

Any suggestions?

Cheers,

Ted
R.E. Byers

2. video on computer?

3. Resolution Problems with TImageList

4. custom shapes vol 8 available

5. Problems w/TImageList (SP2, WinXP)

6. !YOUR VIRTUAL OFFICE CAN DO ALL!!

7. Problem with TImageList.GetIcon

8. The groups response to the question: "Specifically" what can PS do that PSP cannot?

9. Problem on TImageList

10. TToolBar problems with TImageList

11. Is there a problem with TImageList on Win95 vs WinNT?

12. TimageList (Problem);

13. TImageList Problem - Please Help