Einzelnen Beitrag anzeigen

cruso
(Gast)

n/a Beiträge
 
#4

Re: Hilfe! Speicherauslastung steigt ins unermessliche!

  Alt 26. Feb 2006, 09:37
So sieht das ganze für den Dateityp "*.jpg" aus (Beispiel):

Delphi-Quellcode:
var LoadingFile:String; MyJPEG:TJPEGImage; MyBMP:TBitmap;
begin
  LoadingFile:=ListBox1.Items.Strings[ListBox1.ItemIndex];
  if extractfileext(LoadingFile)='.jpgthen begin
  MyJPEG:=TJPEGImage.Create;
  With MyJPEG Do Begin
  LoadFromFile(LoadingFile);
  MyBMP := TBitmap.Create;
  With MyBMP Do Begin
  Width := MyJPEG.Width;
  Height := MyJPEG.Height;
  Canvas.Draw(0,0,MyJPEG);
  SaveToFile(GAD+'DCWallpaper.bmp');
  Free;
  end;
  end;
  if not SystemParametersInfo(SPI_SETDESKWALLPAPER,
  0,
  PChar(GAD+'DCWallpaper.bmp'),
  SPIF_SENDCHANGE OR SPIF_UPDATEINIFILE) then
  RaiseLastOSError;
  end;
Was müsste ich da wie verbessern?
  Mit Zitat antworten Zitat