// Vorraussetzung: TImagelist mit geladenen Bilderchen als Resource
void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, long Col, long Row, TRect &Rect, TGridDrawState State)
{
TStringGrid *Grid = (TStringGrid *)Sender;
if ((ARow != 0) && (ACol != 0))
{
// leeres Bitmapobjekt erzeugen
Graphics::TBitmap *pBitMap = new Graphics::TBitmap;
// Bitmap mit Index 0 aus einer Imagelist herauskopieren
ilFunctionButtons->GetBitmap(0, pBitMap);
if (pBitMap)
{
// Bitmap in den Rect-Bereich der akt. Zelle malen
Grid->Canvas->Draw(Rect.Left, Rect.Top, pBitMap);
// und kopiertes Bitmap löschen
delete pBitMap;
}
}
}