Ich hatte es mal so gemacht :
Code:
aStream := TMemoryStream.Create;
aStream.LoadFromFile('F:\image.png');
outstream := TStringStream.Create;
EncodeStream(aStream, outstream);
Memo2.Lines.Text := outstream.DataString;
outstream.Free;
aStream.Free;
Rückwärts geht genauso, nur mit DecodeStream.