... ist ein Resultat dieser Prozedur:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34:
| procedure TfMain.resizepictures(dir: string; width, height: integer); var i:integer; bmp:TBitmap; jpeg:TJpegImage;
begin filebox.Directory:=dir; for i:=0 to filebox.count-1 do begin Jpeg:=TJpegImage.Create; try jpeg.LoadFromFile(dir+'\'+filebox.Items.Strings[i]); bmp:=TBitmap.Create; try If jpeg.width>jpeg.Height then begin bmp.width:=width; bmp.height:=height; end else begin bmp.width:=height; bmp.Height:=width; end; bmp.canvas.StretchDraw(Rect(0,0,bmp.width,bmp.height),jpeg); jpeg.assign(bmp); finally bmp.free; end; jpeg.SaveToFile(dir+'\'+filebox.items.Strings[i]); finally jpeg.free; end; end; end; |
... man muss dazusagen, zu 90% funktionierts - ihr sehts, das ganze passiert in einer FOR-Schleife und Ziel ist es einen ganzen Ordner voller Bilder zu "verkleinern" -> 10% gehen daneben, siehe oben...
hat jemand von euch eine Idee?
Danke, lg,
Johannes