My problem relates to the other question I have asked about loading image from the URL. The code below works. However, I have encountered the problem if I try to get the image (it suppose be there) but apparently was removed. The application does not know and returns the error. Is there a way to prevent it by capturing incoming error. I would appreciate any suggestions. It happens at his line:
IdHTTP1.get('http://www.google.com/intl/en_ALL/images/logo.gif',MS);
Thanks, Chris
uses
GIFImg;
procedure TForm1.btn1Click(Sender: TObject);
var
MS : TMemoryStream;
GIf: TGIFImage;
begin
MS := TMemoryStream.Create;
GIf := TGIFImage.Create;
try
IdHTTP1.get('http://www.google.com/intl/en_ALL/images/logo.gif',MS);
Ms.Seek(0,soFromBeginning);
Gif.LoadFromStream(MS);
img1.Picture.Assign(GIF);
finally
FreeAndNil(GIF);
FreeAndNil(MS);
end;
end;