Android Question Slider Image from weblink - solved

f0raster0

Well-Known Member
Licensed User
Longtime User
Hey Team

Does anyone have a demo or know how to display an image from a web link?
I currently use the example below for slider images locally, but I'm looking for an option to link to the pictures online, something like this:

Edit: or maybe download the pics and show them locally

thanks in advance

B4X:
Sub ImageSlider1_GetImage (Index As Int) As ResumableSub
    Dim pnl As B4XView = xui.CreatePanel("")
    pnl.SetLayoutAnimated(0, 0, 0, ImageSlider1.WindowBase.Width, ImageSlider1.WindowBase.Height)
    'change to smm.SetMedia for online images.
    smm.SetMediaFromFile(pnl, File.DirAssets, $"test_${Index + 1}.jpg"$, "image/jpeg", CreateMap(smm.REQUEST_CALLBACK: Me))
    Wait For (pnl) SMM_MediaReady (Success As Boolean, Media As SMMedia)
    If Success Then
        Return Media.Media.As(B4XBitmap)
    Else
        'return error image
    End If
End Sub
 
Last edited:

f0raster0

Well-Known Member
Licensed User
Longtime User
To use smm.SetMediaFromFile to slide image. you can download ans save images form weblink using Erel's code snippet
Thanks! Now my sTV-Menu for restaurants can update not only the static menu but also the sliders remotely! ?

 
Upvote 0
Top