|
-
Jan 16th, 2007, 07:27 AM
#1
Thread Starter
Addicted Member
[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.
-
Jan 16th, 2007, 07:32 AM
#2
Re: Icon -> Base64 encoding.
Please mark you thread resolved using the Thread Tools as shown
-
Jan 16th, 2007, 11:27 AM
#3
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
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Jan 16th, 2007, 12:34 PM
#4
Thread Starter
Addicted Member
Re: Icon -> Base64 encoding.
Both work (but with "i As Long" in the second).
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|