TImageList

Top  Previous  Next

DFM-Translator > Special assignments > Binary data > TImageList

Currently, the AssignTImageListBitmap routine for assigning the binary data to the instance of a TImageList at runtime is a dummy routine that makes the converted code compile, but does not work.As a workaround, the images in the list can be saved to the hard drive and loaded one after the other and added to the list.

 

To do this, the Delphi file can first be opened in C++Builder. Double-clicking on the TImagelist icon will then display a dialog that offers the option of saving the individual images.

 

 

Imagelist

 

 

 

 

void AssignTImageListBitmap2(TImageList* xp, const System::DynamicArray<System::Byte>& Bytes)

{

//D:\develop\Delphi2Cpp\Tests\CBTestDone\RichEdit\ToolbarImages.bmp

//        xp->FileLoad(rtBitmap, L"D:\\develop\\Delphi2Cpp\\Tests\\CBTestDone\\RichEdit\\ToolbarImages.bmp", clFuchsia);

       xp->Masked = true;

       TBitmap* pBitmap = new TBitmap;

       pBitmap->LoadFromFile(L"D:\\develop\\Delphi2Cpp\\Tests\\CBTestDone\\TListViewItems\\Images0.bmp");

       xp->AddMasked(pBitmap, clFuchsia);

       pBitmap->LoadFromFile(L"D:\\develop\\Delphi2Cpp\\Tests\\CBTestDone\\TListViewItems\\Images1.bmp");

       xp->AddMasked(pBitmap, clFuchsia);

       pBitmap->LoadFromFile(L"D:\\develop\\Delphi2Cpp\\Tests\\CBTestDone\\TListViewItems\\Images2.bmp");

       xp->AddMasked(pBitmap, clFuchsia);

 

 

       delete pBitmap;

}

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content