invisble Timagelist problems

invisble Timagelist problems

Post by EIDER » Mon, 08 Feb 1999 04:00:00

How can we make invisible an image drawed on a form by Timagelist?
I mean, once i've drawed an image of the imagelist on a form, i want to
delete the image from the form (not from the image list)....?


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;
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

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?


R.E. Byers

2. InDesign: Printing problems with non-PS printer; PageMaker differences...

3. TimageList (Problem);

4. imagine 3.0 manual?

5. TImageList Problem - Please Help

6. ANN: New Tutorial - Virtual Paint Your Walls (masks)

7. Resolution Problems with TImageList

8. phaser fire

9. Problems with TImageList

10. TImageList->GetResource problems...

11. TBitmap, TImageList and pf24bit problem

12. TimageList problem

13. Problems w/TImageList (SP2, WinXP)