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;
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;