To create a TImage at runtime, do the following:
Code:
TImage *img = new TImage(NULL);
It's only contructor accepts TComponent pointer to hold as reference of the object responsible for destroying the TImage. You can pass it NULL(0) if you like. I wouldn't bother deriving a class from TImage for what you want to do.
Because you have created a TImage instance yourself at runtime, don't forget to destroy it - it won't be destroyed automatically like components dragged onto the form in the IDE.
If you want your TImage object to be shown, you need to attach it to a parent window, like so:
Code:
img->Parent = Form1;
That's all there is to it. However, if you just want to hold an array of bitmaps, you could use TBitmap instead of TImage. A bitmap can be copied into an TImage component at anytime using:
Code:
Image1->Picture->Assign( bmp );