Private Sub btnLoadImage_Click
Private n As Int
#If B4A
Chooser.Initialize("Chooser")
Chooser.Show("image/*", "Select an image")
#Else If B4i
#Else If B4J
Private lstExtensions As List
lstExtensions.Initialize2(Array As String("*.bmp", "*.jpg", "*.png"))
Chooser.SetExtensionFilter("Image files", lstExtensions)
Chooser.Title = "Select an image file"
ImageFileName = Chooser.ShowOpen(Main.MainForm)
If ImageFileName <> "" Then
Log(ImageFileName)
n = ImageFileName.LastIndexOf("\")
ImageDir = ImageFileName.SubString2(0, n)
ImageFileName = ImageFileName.SubString(n + 1)
xResizeAndCrop1.LoadImage(ImageDir, ImageFileName)
End If
#End If
End Sub