首页 > 代码库 > delphi从内存流加载图片

delphi从内存流加载图片

function Tform1.GetCodeImg;
var url:string;
response:TMemoryStream;
jpg:TJPEGImage;
begin
   url:='https://kyfw.12306.cn/otn/passcodeNew/getPassCodeNew?module=login&rand=sjrand&0.3110086616057921';
   idhtp1.Get(url,response);
   jpg:=TJPEGImage.Create;
   jpg.LoadFromStream(response);
   img1.Picture.Assign(jpg);
end;

delphi从内存流加载图片