Board index » delphi » Images inside StringGrid's, Listbox's, DrawGrid's etc

Images inside StringGrid's, Listbox's, DrawGrid's etc

Does anyone know how to place a bitmap or any image into a cell in a
StringGrid or into Listbox's or DrawGrid's. I need to do this for a project
in d1 and d2 and the example's in Delphi help do not work - or is it me -
Has anyone got any working code out there I can take a look at ?

Thanx

tda...@dial.pipex.com

 

Re:Images inside StringGrid's, Listbox's, DrawGrid's etc


Use a drawGrid and look at the OnDrawCell method.
DrawGrid1DrawCell(Sender: TObject; Col, Row: Integer;
  Rect: TRect; State: TGridDrawState);
Youll see it sends back the rect value where you can place your bitmap
using canvas.draw method

example will fill the grid with bitmaps
 Drawgrid1.canvas.Draw(rect.left,rect.top,image1.picture.bitmap);

In article <01bca834$96347fc0$54f682c1@ntpc>, Tony Danby
<tda...@dial.pipex.com> writes

Quote
>Does anyone know how to place a bitmap or any image into a cell in a
>StringGrid or into Listbox's or DrawGrid's. I need to do this for a project
>in d1 and d2 and the example's in Delphi help do not work - or is it me -
>Has anyone got any working code out there I can take a look at ?

>Thanx

>tda...@dial.pipex.com

--
Claire Humphrey

Other Threads