Android Question Encode bitmap to Base64 string.

Rega

New Member
Licensed User
Longtime User
Hi,

I'm trying to encode a bitmap to Base64 string.
Does anyone have a good answer how it's done?

Public Sub ConvertImageToStrong(objImage As Bitmap) As String

Dim arrBitmap() As Byte
Dim strBitmap As String

strBitmap = ......
Return strBitmap

End Sub

I can't use Base64Image lib, since I have to convert from bitmap in memory and not from file.
I could use Base64 library, but must then convert bitmap to byte array. Can find method for this.

Thank you in advance.
 

sirjo66

Well-Known Member
Licensed User
Longtime User
I think that you can save your bitmap on a temporary file, then use Base64Image library, and then delete the temporary file

Sergio
 
Upvote 0

Rega

New Member
Licensed User
Longtime User
Hello and thanks for your answer.
It will be my temporary work arround.
I was hoping to avoid doing this.

Torgeir
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
Because i also need it for my current project: the next version of my MFLib will include a Base64 encoding function with bitmap object as parameter. No need to save it as file. In the next few days (at the latest on the next weekend) it will be ready.
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
Upvote 0
Top