Einzelnen Beitrag anzeigen

Benutzerbild von Mirilin
Mirilin

Registriert seit: 21. Dez 2002
Ort: Lenzburg
861 Beiträge
 
Delphi 6 Professional
 
#6

Re: Alle Bilder eines Ordners in Listbox auflisten und anzei

  Alt 22. Jul 2004, 12:45


Die Items enthalten ja den DateiNamen

So in der Art (für bmps)
Delphi-Quellcode:
  
procedure TMainForm.ListBoxDrawItem(Control: TWinControl; Index: Integer;
  aRect: TRect; State: TOwnerDrawState);
var
  Bit : TBitmap;
  ...
begin
  ...
  with TListBox(Control) do
  begin
    ...
    Bit.LoadFromFile(Items[Index]);
    Canvas.StretchDraw(Rect(aRect.Left+2, aRect.Top+2, aRect.Left+ItemHeight-4, aRect.Bottom-2), Bit);
    Canvas.TextOut(aRect.Left+ItemHeight, aRect.Top+2, Items[Index])
    ...
  end;
  ...
end;

mfg Tobias
Tobias
Die Physik ist für die Physiker eigentlich viel zu schwer.
  Mit Zitat antworten Zitat