Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, July 24, 2019 8:21:03 AM(UTC)

Hadi  
Hadi

Groups: Manager, Tech Support, Administrators
Posts: 218

Was thanked: 12 time(s) in 12 post(s)

In computer science Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each Base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit Base64 digits.

Common to all binary-to-text encoding schemes, Base64 is designed to carry data stored in binary formats across channels that only reliably support text content. Base64 is particularly prevalent on the World Wide Web where its uses include the ability to embed image files or other binary assets inside textual assets such as HTML and CSS files.

Base64 encoding schemes are commonly used when there is a need to encode binary data that needs be stored and transferred over media that are designed to deal with textual data. This is to ensure that the data remains intact without modification during transport.

If your application has a requirement to load and display Base64 strings, you can use the following methods to load and Display them in the ImageViewer or DocumentViewer:

Code:
      static LEADDocument LEADDocumentFrom64(string b64Str)
      {
         byte[] bytes = Convert.FromBase64String(b64Str);
         using (MemoryStream ms = new MemoryStream(bytes))
         {
            return DocumentFactory.LoadFromStream(ms, new LoadDocumentOptions());
         }
      }


Code:
      static RasterImage RasterImageFrom64(string b64Str)
      {
         byte[] bytes = Convert.FromBase64String(b64Str);
         using (RasterCodecs rc = new RasterCodecs())
         using (MemoryStream ms = new MemoryStream(bytes))
         {
            return rc.Load(ms);
         }
      }
Hadi Chami
Developer Support Manager
LEAD Technologies, Inc.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.063 seconds.