[RESOLVED] Icon -> Base64 encoding.
I want to encode an icon in order to store it in a XML file , I have many Base64 encoder but the problem is that I want to know how to encode an icon.
I thought that I should open it for binary & send the retrieved string to my encoders but opening icons for binary always give me error 62 past end of file , I made a search here & I found topics marked as resolved about this but all methods in it either fail or give my the same error , so any ideas about how to do this , thanks.
Re: Icon -> Base64 encoding.
Re: Icon -> Base64 encoding.
VB Code:
Private Sub LoadIcon(f As String)
Dim b() As Byte
Open f For Binary As #1
ReDim b(LOF(1))
Get #1, 1, b
Close #1
'b is an array of byte that holds the entire .ico file contents.
'if you need it as a string ...
Dim s As String, i As Integer
For i = 0 To UBound(b) - 1
s = s & Chr$(b(i))
Next i
End Sub
Re: Icon -> Base64 encoding.
Both work (but with "i As Long" in the second).
Thanks :wave: