This code is supposed to resize a TBitmap, but the resulting bitmap is just a white image (with the final size). I'm using it to resize to a lower size.
function ResizeBitmap(B: TBitmap; Width, Height: Integer): TBitmap;
var
finalbitmap: TBitmap;
begin
finalbitmap := TBitmap.Create(Width, Height);
finalbitmap.Clear(0);
if finalbitmap.Canvas.BeginScene then
try
finalbitmap.Canvas.DrawBitmap(B, RectF(0,0,B.Width,B.Height), RectF(0,0,Width,Height), 1);
finally
finalbitmap.Canvas.EndScene;
end;
Result := finalbitmap;
end;
Any idea what is happening?
Finally I've modified the php to resize the uploaded image. I'm not able to know what is wrong with my delphi code.