不下载直接从TMEMORYSTREAM中读取图片.

2019-04-15 16:52发布

procedure TForm1.Button1Click(Sender: TObject);
var
  tms: tmemorystream;
  jpg: tjpegimage;
begin
  tms := tmemorystream.Create;
  IdHTTP1.Get('http://218.204.253.41/ydPicFile/pic/20060526/A11235/A1123516.jpg', tms);
  tms.Position := 0;
  jpg:=tjpegimage.Create ;
  jpg.LoadFromStream(tms);
  Image1.Picture.Assign(jpg);
end;