Can someone help me how to conver jpg,png,gif to binary code using vb6 please.

 Public Function GetPhoto(ByVal filePath As String) As Byte()
     Dim stream As FileStream = New FileStream(filePath, FileMode.Open, FileAccess.Read)
     Dim reader As BinaryReader = New BinaryReader(stream)

     Dim photo() As Byte = reader.ReadBytes(stream.Length)

     reader.Close()
     stream.Close()

     Return photo
 End Function
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.