I suggest you do the following:
- Save to stream in memory. Use TMemoryStream and call SaveToStream on the bitmap.
- Stream compression, possibly with a zlib block. This step is optional.
- Encode a stream using base64. For example, you can use the functions provided by Soap.EncdDecd.
And in the opposite direction, well, you just undo the steps.
source share