J jvrh_1 Active Member Licensed User Dec 20, 2019 #1 Hello! I need your help! I have several images in my webpage and I want to show these images in my webview. When I write webv(I).LoadUrl("http://www.xxxxxxx.photo.jpg") I can not see all the image, only a corner. Is there any way of adjusting the image to the webview size? I can't download these images to my app because there are a lot of them. I need to load it online. If I could load the images in an imageview, it would be perfect! Thanks for you help.
Hello! I need your help! I have several images in my webpage and I want to show these images in my webview. When I write webv(I).LoadUrl("http://www.xxxxxxx.photo.jpg") I can not see all the image, only a corner. Is there any way of adjusting the image to the webview size? I can't download these images to my app because there are a lot of them. I need to load it online. If I could load the images in an imageview, it would be perfect! Thanks for you help.
S sorex Expert Licensed User Longtime User Dec 21, 2019 #3 you need to fix it in your html or external css file Upvote 0
J jvrh_1 Active Member Licensed User Dec 21, 2019 #4 Really? There is not another way?. Can I not to do un muy app? Using a diferent container (nota webview)? Upvote 0
Really? There is not another way?. Can I not to do un muy app? Using a diferent container (nota webview)?
Toky Olivier Active Member Licensed User Longtime User Dec 22, 2019 #5 Download the image from your website and assign it to an ImageView not WebView for example. See a tuto from by Erel: https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/ There is ready to use Sub: Code: Sub DownloadImage(Link As String, iv As ImageView) Dim j As HttpJob j.Initialize("", Me) j.Download(Link) Wait For (j) JobDone(j As HttpJob) If j.Success Then iv.Bitmap = j.GetBitmap End If j.Release End Sub Upvote 0
Download the image from your website and assign it to an ImageView not WebView for example. See a tuto from by Erel: https://www.b4x.com/android/forum/threads/b4x-okhttputils2-with-wait-for.79345/ There is ready to use Sub: Code: Sub DownloadImage(Link As String, iv As ImageView) Dim j As HttpJob j.Initialize("", Me) j.Download(Link) Wait For (j) JobDone(j As HttpJob) If j.Success Then iv.Bitmap = j.GetBitmap End If j.Release End Sub
S sorex Expert Licensed User Longtime User Dec 22, 2019 #6 jvrh_1 said: There is not another way?. Can I not to do un muy app? Click to expand... you have (atleast) 2 options. either you use the real app way as Toky showed above with some aditional sizing code. or you use a webview and put your images in an html file with the needed styling to make them fit to the given 'screen' (webview) size. option 2 remains a oneliner while option 1 requires some more code especially when you want to display several images on screen with the correct aspect ratio etc... it all depends what you want to do with the shown images. Upvote 0
jvrh_1 said: There is not another way?. Can I not to do un muy app? Click to expand... you have (atleast) 2 options. either you use the real app way as Toky showed above with some aditional sizing code. or you use a webview and put your images in an html file with the needed styling to make them fit to the given 'screen' (webview) size. option 2 remains a oneliner while option 1 requires some more code especially when you want to display several images on screen with the correct aspect ratio etc... it all depends what you want to do with the shown images.