//---------------------------------------------------------------------------
//Set
the Width and Height of the ImageList
ImageList1->Width
= 75;
ImageList1->Height
= 150;
//Add
a bitmap to the ImageList
Graphics::TBitmap
*TempBitmap = new Graphics::TBitmap();
TempBitmap->LoadFromFile("mybitmap.bmp");
ImageList1->Add(TempBitmap,
NULL);
delete
TempBitmap;
//Add
a bitmap to the ImageList and specify a transparent color
Graphics::TBitmap
*TempBitmap = new Graphics::TBitmap();
TempBitmap->LoadFromFile("mybitmap2.bmp");
ImageList1->AddMasked(TempBitmap,
clBlack);
delete
TempBitmap;
//Draw
an image from the ImageList to a Canvas at (5,10)
int
index = 0; //zero-based index of image in
imagelist to draw
ImageList1->Draw(Canvas,
5, 10, index);
//Retrieve
a bitmap from the ImageList
int
index = 0; //zero-based index of image in
imagelist to retrieve
ImageList1->GetBitmap(index,
Image1->Picture->Bitmap);
//Clear
all images from the ImageList
ImageList1->Clear();
|