ImageView Problem

bryanh

Member
Licensed User
Longtime User
Used the following code to load an imageview with an image - chooser is a ContentChooser ('cc') - image selected from gallery.

Sub Button4_Click
cc.Show("image/*", "Choose image")
End Sub

Sub chooser_Result (Success As Boolean, Dir As String, FileName As String)
If Success Then
ImageView1.Bitmap = LoadBitmap (Dir, FileName)
picdir = Dir: picfile = FileName
Else
picdir = "": picfile = ""
End If
End Sub

This works OK when image is first selected. However, when I later try to load ImageView1 with the same file, using the variables 'picdir' and 'picfile', things just don't work. The variables do not, in fact, give the true directory and file names - rather they are 'ContentDir' and 'content://media/external/images/... etc', and when I use 'ImageView1.Bitmap = LoadBitmap(picdir,picfile)' an error message indicates no such file.

Any ideas about other ways of loading an image stored on the phone/tablet into imageview?
 
Top