Einzelnen Beitrag anzeigen

Ayumi

Registriert seit: 20. Apr 2005
18 Beiträge
 
#1

Stringgrid image einfügen

  Alt 7. Mär 2006, 14:01
Hallo an Alle,

ich füge folgendermaßen ein Bild in die erste Spalte meines StringGrids ein:

Delphi-Quellcode:
procedure TForm1.Stringgrid1DrawCell( Sender : TObject;
                                                ACol,
                                                ARow : Integer;
                                                Rect : TRect;
                                                State : TGridDrawState);

begin
 if (ARow > 0) and (ACol = 0) then SetCellPicture(Rect,Image1.Picture.Bitmap,Stringgrid1);
end;


procedure TForm1.SetCellPicture(Rect: TRect; Picture: TGraphic; Grid : TStringGrid);

begin
  grid.Canvas.Draw(Rect.Left,Rect.Top,Picture);
end;
Ich möchte aber dass das Bild genauso groß ist wie meine Stringgrid-zelle.
Wie kann ich das machen?

Ich bin wirklich sehr dankbar für jede Hilfe.
  Mit Zitat antworten Zitat