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

emexes

Expert
Licensed User
Longtime User
Unrecognized class member: getbitmap

Presumably aiming for this but overshot by three letters 🍻

1739947135857.png
 
Upvote 0
Top