Android Question How to modify the ReadFile function to read the image loaded by the ImageView1 control?

bskotu555

Active Member
B4A:
Sub ReadFile(Dir As String, FileName As String) As Byte()
    Dim out As OutputStream
    out.InitializeToBytesArray(100) 'size not really important
    File.Copy2(File.OpenInput(Dir, FileName), out)
    Return out.ToBytesArray
End Sub
 

aeric

Expert
Licensed User
Longtime User
Maybe like this:
B4X:
ImageView1.GetBitmap.WriteToStream(out, 100, "PNG")
Return out.ToBytesArray
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…