B4A Class Camera Folder (or other dir) Image File Chooser - XUI - xCLV

Discussion in 'Additional libraries, classes and official updates' started by Harris, Dec 1, 2018.

  1. Harris

    Harris Well-Known Member Licensed User

    Inspired by (and code used) from this thread...

    I needed an image picker to get camera photos when the user took pictures outside my app - but wants to include these camera images (one or more)... You can modify to choose any type of file. Scales to any device density.

    xCustomListView is so powerful and I use it, more often than not for all new projects and UI classes.

    This example starts by showing JPG or PNG files in the [DCIM/Camera] folder. It will load the first 20 images (or less) found in the folder.
    Every selected image is added to a map (or de-selected - removed from map) - which is returned to the Wait For....
    The Prev / Next buttons show the available (20) images...
    The (back) ../Camera will allow to select a different directory.


    Since each list item thumbnail is hard to view, clicking the imageview will show a larger image.


    With a little work, please make this iOS usable and post your results...

    Example Use:
    Sub sInputList_Show_Click

    Log(" waiting here for result")
    Wait For (imgFP.WaitForResult) Complete (Result As Map)
    Log(" was waiting here - got result "&Result)

    If Result.Size > 0 Then  ' show images from map - or do what you want (like post to a server)
          For i = 0 To Result.Size - 1
           UpdIv(Result.GetValueAt(i), Result.GetKeyAt(i))
    ToastMessageShow(" All Selected Images Were Shown",True)   
    ToastMessageShow(" nothing was selected",True)   
    End If

    End Sub
    Full Example project (and class) in attached zip...

    Attached Files:

    Last edited: Dec 1, 2018
  2. Harris

    Harris Well-Known Member Licensed User

    Reserved for class updates...

    Updated imgFilePick class to use XUI standards.
    Changed bitmap to B4XBitmap (thanks to Klaus for pointing this out in other threads)
    Changed .color to xui.color
    Fixed Cancel button to break from loop and return the empty map (complete the Main Wait For)
    Added many comments to code...


    Attached Files:

    Last edited: Dec 2, 2018
    hibrid0 and Erel like this.
  3. Harris

    Harris Well-Known Member Licensed User

    Updated class in above post...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice