Android Question Show image in the Imageview control on the Layout

Makumbi

Well-Known Member
Licensed User
How can i load the browsed photo into the imageview control on my layout thank you in Advance

B4X:
Dim chooser As ContentChooser
    If chooser.IsInitialized = False Then
        chooser.Initialize("chooser")
    End If
    
    chooser.show("image/*", "Choose image")
    
    Wait For(chooser) chooser_Result (Success As Boolean, Dir As String, FileName As String)

    Log(Dir)
    Log(FileName)

          
    Dim InputStream1 As InputStream
    InputStream1 = File.OpenInput(Dir, FileName)
    Dim OutputStream1 As OutputStream
    OutputStream1.InitializeToBytesArray(1000)
    File.Copy2(InputStream1, OutputStream1)
    Dim Buffer() As Byte 'declares an empty array
    Buffer = OutputStream1.ToBytesArray
 
Top