Einzelnen Beitrag anzeigen

bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.123 Beiträge
 
Delphi 11 Alexandria
 
#1

Probleme mit der ImageList

  Alt 29. Feb 2016, 08:38
ich möchte einzelne Bilder aus meiner ImageList als Bitmap weiterverwenden.
Speichere ich mit der Funktion DebugImageListContent meine ImageListe auf meine Festplatte sind alle Bilder verfügbar,
die Anweisung Symbol.SaveToFile liefert mir nur ein leere Bitmaps .... wieso ?



Delphi-Quellcode:
   var Symbol: TBitMap;


   begin
         Symbol := TBitMap.Create;

        .....
        ....

        i := ..... ; /// I [ 0 ... Imagelist Count-1]

        
        MyOBJImageList.GetBitmap(i - 1, Symbol);

        DebugImageListContent (MyOBJImageList, 'c:\temp', 'ObjList');

        Symbol.SaveToFile('c:\temp\symbol' + INtToStr(ObjectIndex) + '.bmp');

  end;

procedure DebugImageListContent (aImageList: TImageList; RootPath, Filename : String);
var i : Integer;
      Fullfilename : String;
      aImage : TBitMap ;
begin
     for i := 0 to aImageList.Count-1 do
       begin
           aImage :=TBitMap.Create;
           aImageList.GetBitmap( i , aImage );
           FullFilename := RootPath + '\' + Filename + IntToStr(i) + '.bmp' ;
           aImage.SaveToFile(FullFilename);
           aImage.Free;
       end;
end;
  Mit Zitat antworten Zitat