将C# Web Service返回的图片以流的形式显示在Delphi中的Image控件

 C#写的Web Service里代码如:
string imageData = Convert.ToBase64String( result.Object.Image );

Delphi客户端调用:
var
  lNodeText: string;
  lSS: TStringStream;
  ljpg: TJPEGImage;
begin
  lNodeText := GetNodeValue('//Data/Image');
  if lNodeText <> '' then
  begin
    lNodeText := DecodeString(lNodeText);
    lSS := TStringStream.Create(lNodeText);
    try 
      jpg := TJPEGImage.Create;
      try
        ljpg.LoadFromStream(lSS); 
        Result := ljpg; 
      except
         Result := nil; 
      end; 
    finally
      lSS.Free;
    end;
  end;
end; 

你可能感兴趣的:(Web,Services,delphi,service,c#,image,web,string)