Mega Code Archive

 
Categories / Delphi / Graphic
 

Put a Bitmap in a StringGrid cell

Title: Put a Bitmap in a StringGrid cell Question: How can I put a Bitmap in a StringGrid cell? Answer: In your StringGrid's OnDrawCell event handler, place some code that resembles: with (Sender as TStringGrid) do with Canvas do begin {...} Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic); {...} end; Using the Draw() or StretchDraw() method of TCanvas should do the trick. BTW, Image1 above is a TImage with a bitmap already loaded into it.