DelphiAaron
Programmer
i have this function that takes a jpg and returns a bmp but the result bitmap is not freed unless theres an exception, and of course you cant free it here otherwise the result is not returned. ??
Aaron Taylor
John Mutch Electronics
Code:
function MakeBmp(Source : TGraphic): TBitmap;
begin
Result := TBitmap.create;
Try
with Result do
begin
Width := Source.Width;
Height := Source.Height;
Canvas.Draw(0,0,Source);
end;
except
Result.Free;
raise;
end;
end;
Aaron Taylor
John Mutch Electronics