jpeg error #42

2016-08-31 20:18:37来源:CSDN作者:l09120204人点击

  try
    try
      Stream := TMemoryStream.Create;
      Jpeg := TJPEGImage.Create;

      idc.Get('http://xxxxx/RandomImgGenServlet',Stream);

      Jpeg.LoadFromStream(Stream);
      F_query.Image1.Picture.Bitmap.Assign(Jpeg);
      F_query.Image1.Show;
    except
    end;
  finally
    Stream.Free;
    Jpeg.Free;

  end;


加载流时报错jpeg error  #42



  try
    try
      Stream := TMemoryStream.Create;
      Jpeg := TJPEGImage.Create;

      idc.Get('http://xxxxx/RandomImgGenServlet',Stream);
  

      Stream.position := 0;//应指到流首位

      Jpeg.LoadFromStream(Stream);
      F_query.Image1.Picture.Bitmap.Assign(Jpeg);
      F_query.Image1.Show;
    except
    end;
  finally
    Stream.Free;
    Jpeg.Free;
  end;


加载图片正常

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台