Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
Delphi 2006 Professional
|
Re: Bildervorschau programmieren.
10. Apr 2007, 19:48
Hallo,
was hältst du davon?
Delphi-Quellcode:
//Dim = Dimensions = Abmessungen
procedure DrawPictures(Canvas: TCanvas; Columns, Dim, Spacing: Cardinal; Pictures: TObjectList);
var
row,col,pic,rows,x,y: Integer;
begin
rows := Columns div Pictures.Count;
for row := 0 to rows+1-1 do
for col := 0 to Columns-1
begin
pic := row * Columns + col;
if Pictures.Count <= pic then Exit;
if not Pictures[picture] is TPicture then Exit;
x := (Dim+2*Spacing) * row + Spacing;
y := (Dim+2*Spcing) * col + Spacing;
Canvas.Stretchdraw(rect(x,y,x+Dim,y+Dim),Pictures[picture] as TPicture); //bitte durch anständige zeichenroutine (zentrieren etc.) ersetzen
end;
end;
Lukas Erlacher
|
|
Zitat
|