AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Stringgrid image einfügen

Ein Thema von Ayumi · begonnen am 7. Mär 2006 · letzter Beitrag vom 8. Mär 2006
Antwort Antwort
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
Niko

Registriert seit: 23. Jun 2003
416 Beiträge
 
Delphi 2006 Professional
 
#2

Re: Stringgrid image einfügen

  Alt 7. Mär 2006, 17:12
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;
  Mit Zitat antworten Zitat
Ayumi

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

Re: Stringgrid image einfügen

  Alt 8. Mär 2006, 10:42
Dankeschön, so funktioniert es.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:44 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz