![]() |
Stringgrid image einfügen
Hallo an Alle,
ich füge folgendermaßen ein Bild in die erste Spalte meines StringGrids ein:
Delphi-Quellcode:
Ich möchte aber dass das Bild genauso groß ist wie meine Stringgrid-zelle.
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; Wie kann ich das machen? Ich bin wirklich sehr dankbar für jede Hilfe. |
Re: Stringgrid image einfügen
Hi,
dafür gibt's die Methode StretchDraw:
Delphi-Quellcode:
procedure TForm1.SetCellPicture(Rect: TRect; Picture: TGraphic; Grid : TStringGrid);
begin Grid.Canvas.StretchDraw(Rect, Picture); end; |
Re: Stringgrid image einfügen
Dankeschön, so funktioniert es. :P
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:57 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz