Autor Beitrag
Karstadt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 174

Windows 2000 / XP
Delphi 7 Pro
BeitragVerfasst: Do 21.09.06 00:21 
ausblenden volle Höhe Delphi-Quelltext
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:
procedure Resizepicture(var Datei: TJpegImage; width, height: Integer);
var bmp:TBitmap;
begin
   Try
     bmp:=TBitmap.Create;
     try
     If Datei.width>Datei.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),Datei);
     Datei.assign(bmp);

     finally
       bmp.free;
     end;

   except
     on e:exception do
     begin
       beep;
     end;
   end;
end;


Diese Skalierfunktion verkleinet die bilder. Aber die Qualität ist nicht gut. gibt es ander möglichkeiten ein Bild so ähnlich zu skalieren? In möglich guten Qualität.
OldGrumpy
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 82



BeitragVerfasst: Do 21.09.06 00:34 
Verfahren gibt es zahlreiche, Lanczos, B-Spline, Bell, Mitchell, Triangle, Hermite... mehr fallen mir gerade nicht ein. Dürfte auch für jeden der Algorithmen etliche Implementationen geben, Google doch einfach mal :)