Hello, please I tried using this tool to convert an image (.jpg) into byte array and got the following: error: incompatible types: byte[] cannot be converted to byte Need help please.
The Sub should be declared to return an array, not a single byte.
B4X:
Sub GetImageBytes() As Byte() '<---- Here
Dim bytes() As Byte = Bit.InputStreamToBytes(File.OpenInput(File.DirRootExternal,"MyApp/profile.jpg")) '<--- Also, there was a missing closing ')'
Return bytes
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.