I\'m using Delphi 2009 and I\'d like to scale an image to fit the available space. the image is always displayed smaller than the original. the problem is TImage Stretch p
You really, really want to use Graphics32.
procedure DrawSrcToDst(Src, Dst: TBitmap32);
var
R: TKernelResampler;
begin
R := TKernelResampler.Create(Src);
R.Kernel := TLanczosKernel.Create;
Dst.Draw(Dst.BoundsRect, Src.BoundsRect, Src);
end;
You have several methods and filters to choose when resampling an image. The example above uses a kernel resampler (kinda slow, but with great results) and a Lanczos filter as reconstruction kernel. The above example should work for you.