Delphi 2010 - Decode Base64 encoded image from XML doc
- by James
I am trying to decode a base64 encoded EMF image from an XML document in my application and render it on screen, however, it never seems to appear.
If I copy/paste the data from the XML document into Notepad++ and use the Base64 Decode option and save the file as a .emf it opens fine in mspaint. So I think the issue is how I am decoding it.
I have tried the following decode methods described in these articles:
How to encode / decode Base 64 string
http://www.swissdelphicenter.ch/torry/showcode.php?id=1223
I have also tried the TIdDecoderMIME class to no avail.
Does anyone know the most reliable way of decoding a base64 encoded string from XML?