Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Komplette Imagelist abspeichern? (https://www.delphipraxis.net/17427-komplette-imagelist-abspeichern.html)

maximi 5. Mär 2004 13:03


Komplette Imagelist abspeichern?
 
Hallo!
Kann ich eigentlich eine komplette Imagelist abspeichern? Oder kann man vielleicht mehrere Images in eine Datei speichern?

Max

DelphiDeveloper 5. Mär 2004 13:20

Re: Komplette Imagelist abspeichern?
 
hi max mir fällt nix besseres ein als das so zu machen

Code:
procedure BilchenAufPlatte;
var
  image1: TBitMap;
  i: integer;
begin

  image1 := TBitMap.Create;
  for i := 0 to ImageList1.Count - 1 do
  begin
    ImageList1.GetBitmap(i, Image1);
    image1.SaveToFile('c:\bildchen' + inttostr(i) + '.bmp');
  end;
  image1.Free;

end;

maximi 5. Mär 2004 13:28

Re: Komplette Imagelist abspeichern?
 
also das möchte ich gerade nicht. ich möchte in eine datei viele bilder abspeichern und die dann auch alle wieder laden können!

DelphiDeveloper 5. Mär 2004 13:52

Re: Komplette Imagelist abspeichern?
 
achso alle auf einmal in eine bitmap wie bei dem entwurfszeiteditor mit der
funktion "exportieren"

Code:
procedure TForm1.SaveImageListasBitMap(MyImageList: TImageList; const sOutputFile: string);
var
  Bmp : TBitmap;
  i : Integer;
begin
  Bmp := TBitmap.Create;
  try
    Bmp.Width := MyImageList.Width*ImageList1.Count;
    Bmp.Height := MyImageList.Height;

    with Bmp.Canvas do
    begin
      Brush.Color := clOlive;
      Brush.Style := bsSolid;
      FillRect(ClipRect);
    end;
    for i := 0 to MyImageList.Count-1 do
      MyImageList.Draw(Bmp.Canvas, i*MyImageList.Width, 0, i);
    Bmp.SaveToFile(sOutputFile);
  finally
    Bmp.Free
  end;
end;


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:46 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