Home > Back-end >  C builder after 6 how to read the image from the local base64 code
C builder after 6 how to read the image from the local base64 code

Time:11-23

There is a best example...

CodePudding user response:

With IdBase64Encoder1 and IdBase64Decoder1 in indy misc project component cary,

Example:
Void __fastcall TForm1: : Button1Click (TObject * Sender)
{
IdBase64Encoder1 - & gt; CodeString (Memo1 - & gt; The Text);
AnsiString s=IdBase64Encoder1 - & gt; CompletedInput ();
Int pos=supachai panitchpakdi OS (";" );
Memo2 - & gt; Text=s.S ubString (pos + 1, s.L ength () - pos);
}
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Void __fastcall TForm1: : Button2Click (TObject * Sender)
{
IdBase64Decoder1 - & gt; CodeString (Memo2 - & gt; The Text);
AnsiString s=IdBase64Decoder1 - & gt; CompletedInput ();//if you do not comply with the rules of Base64, an error (Coding table entry not found)
Int pos=supachai panitchpakdi OS (";" );
Memo2 - & gt; Text=s;
Memo3 - & gt; Text=s.S ubString (pos + 1, s.L ength () - pos);
}

If you use XE, the name changed to IdEncoderMIME,

CodePudding user response:

If it is a coded pictures on the harddisk? How to implement??
  • Related