iOS Question Album from asset images and scrollview slideshow.

narek adonts

Well-Known Member
Licensed User
you can create a folder with File.MakeDir and use File.Copy to copy your image files to that folder.
To show it as an photo album you will need some Gride View. As as I know there is no open source gride view for b4i you can implement yours with a scrollview.
Upvote 0


Licensed User
Ok, this is what I have tried, everything seems to be working but when my page opens, only the last image is shown.

1. I created a view with a panel and inside this panel a label and an image view, I call this layout slideImage. It's designer scripts are:

pnlMaster.SetLeftAndRight(0, 100%x)
pnlMaster.SetTopAndBottom(0, 100%y)
lblTitle.SetLeftAndRight(0, 100%x)
lblTitle.SetTopAndBottom(0, 10%y)
imgPicture.SetLeftAndRight(0, 100%x)
imgPicture.SetTopAndBottom(10%y, 100%y)

Then I created another layout with a scrollview inside with pagination enabled, with its script being:

svSlideShow.SetTopAndBottom(0, 100%y)

Now, I read my images from a database like this...

Sub LoadSlideShow()
    b4iMash.ShowProgress("Loading slideshow...")
    ' clear all views in the panel
    Dim cur As ResultSet
    Dim sPath As String
    cur = b4iMash.Table_OpenRecordset(b4iMash.SQLite,"select * from [Pictures] order by [Key]")
    Do While cur.NextRow
        Dim sKey As String: sKey = cur.GetString("Key")
        Dim sText As String: sText = cur.GetString("Text")
        Dim sTag As String: sTag = cur.GetString("Tag")
        sPath = sTag.replace("[","")
        sPath = sPath.replace("]","")
        sPath = sPath.replace(",","")
        sPath = sPath.replace("-","")
        sPath = sPath.ToLowerCase & ".jpg"
        ' load a new panel and inset image
        Dim pnlImage As Panel
        ' get the parent panel
        pnlMaster = pnlImage.GetView(0)
        ' get the label inside the panel
        lblTitle = pnlMaster.GetView(0)
        lblTitle.Text = sText
        imgPicture = pnlMaster.GetView(1)
        imgPicture.Bitmap = LoadBitmap(File.DirAssets, sPath)
        svSlideShow.ContentWidth = pnlImage.Width
        svSlideShow.ContentHeight = pnlImage.Height
End Sub

The page shows and shows the last image, how do I get the scrollview to show the first image i.e. first view added and then provide a way to slide through the images.
Upvote 0