Italian Come far caricare all'utente un'immagine a scelta

SSDM71

Active Member
Licensed User
Mi chiedo come si fa a caricare un immagine da applicazione con b4a, grazie!
 

udg

Expert
Licensed User
Qualcosa del genere:
B4X:
Dim cc As ContentChooser
Dim p as Panel
Dim TileImg As Bitmap
..
Dim btn1 As Button
btn1.Initialize("btnimg")
btn1.Text="selezona immagine"
p.AddView(btn1, 10dip, 10dip, 200dip, 200dip)
...

Sub btnimg_click
  cc.Initialize("CC")
   cc.Show("image/*","Choose image")
End Sub

Sub CC_Result(Success As Boolean, Dir As String, FileName As String)
  If Success = True Then
     TileImg.InitializeSample(Dir,FileName,800dip,800dip) 
  Else
    Msgbox("Image failed to load.","Error")
  End If
End Sub
 
Top