What am I doing wrong here?
If bmp.width =< then it works okay
If bmp.width > does not scale correctly
What am I doing wrong?
if (checkboxresize.Checked) then
begin
if bmp.Width > bmp.Height then
begin
bmp.ResampleFilter := rfBestQuality;
BGRAReplace(bmp,
// bmp.resample(width,height)
bmp.Resample(screen.width,(screen.Width * bmp.Height) div bmp.Width) as TBGRABitmap);
end
else
begin
bmp.ResampleFilter := rfBestQuality;
BGRAReplace(BMP,
bmp.resample((screen.Height * bmp.Width) div bmp.Height,screen.height) as TBGRABitmap);
end;