G
Guest
I want to convert jpeg's to Hex but I don't really seem to get it right.
The code I use is the following:
Private Function tmpGetByteFileFromDisk(ByVal FilePath As String) As Byte()
Try
Dim fs As FileStream = New FileStream(FilePath, FileMode.Open,
FileAccess.Read)
Dim br As BinaryReader = New BinaryReader(fs)
Dim i As Integer
Dim photo As String
br.Read()
Dim p As String
For i = 0 To 40697
p = Hex(br.ReadByte)
If Len(p) = 1 Then
photo = photo & "0" & p
Else
photo = photo & p
End If
Next
TextBox1.Text = photo
br.Close()
fs.Close()
I want this done to insert the image into a rtf-document using the
streamwriter object, this way I can generate rtf-documents without all the
overhead of starting the word.application.
Suggestions greatly appreciated.
The code I use is the following:
Private Function tmpGetByteFileFromDisk(ByVal FilePath As String) As Byte()
Try
Dim fs As FileStream = New FileStream(FilePath, FileMode.Open,
FileAccess.Read)
Dim br As BinaryReader = New BinaryReader(fs)
Dim i As Integer
Dim photo As String
br.Read()
Dim p As String
For i = 0 To 40697
p = Hex(br.ReadByte)
If Len(p) = 1 Then
photo = photo & "0" & p
Else
photo = photo & p
End If
Next
TextBox1.Text = photo
br.Close()
fs.Close()
I want this done to insert the image into a rtf-document using the
streamwriter object, this way I can generate rtf-documents without all the
overhead of starting the word.application.
Suggestions greatly appreciated.