Duque Active Member Licensed User Longtime User Jul 9, 2021 #1 Friends some solution for this, in targetSdkVersion=29- shows the image in both controls, in targetSdkVersion=30 does not help B4X: Copy File.Copy(File.DirAssets,"like.jpg",File.DirInternal,"like.jpg") Dim src As String = File.DirInternal & "/like.jpg" ImageView1.Bitmap = LoadBitmap(src, "") WebView1.LoadHtml($"<img src='${src}'>"$)
Friends some solution for this, in targetSdkVersion=29- shows the image in both controls, in targetSdkVersion=30 does not help B4X: Copy File.Copy(File.DirAssets,"like.jpg",File.DirInternal,"like.jpg") Dim src As String = File.DirInternal & "/like.jpg" ImageView1.Bitmap = LoadBitmap(src, "") WebView1.LoadHtml($"<img src='${src}'>"$)
roumei Active Member Licensed User Jul 9, 2021 #2 You can use WebViewSettings to allow the file access (https://www.b4x.com/android/forum/threads/webviewsettings.12929/#content): B4X: Copy Private xui As XUI Private wvs As WebViewSettings wvs.setAllowFileAccess(WebView1, True) WebView1.LoadHtml($"<img src="${xui.FileUri(File.DirInternal, "image.jpg")}"/>"$) Upvote 0
You can use WebViewSettings to allow the file access (https://www.b4x.com/android/forum/threads/webviewsettings.12929/#content): B4X: Copy Private xui As XUI Private wvs As WebViewSettings wvs.setAllowFileAccess(WebView1, True) WebView1.LoadHtml($"<img src="${xui.FileUri(File.DirInternal, "image.jpg")}"/>"$)
Erel B4X founder Staff member Licensed User Longtime User Jul 9, 2021 #3 [B4X] Use WebView to show large images Better to use: [B4X] HugeImageView - show very large images Depends on: XUI and JavaObject. 'xui is a global XUI object. Private Sub ShowImage(WV As WebView, Dir As String, FileName As String) #if B4A Dim jo As JavaObject = Me jo.InitializeContext 'comment this line if calling this... www.b4x.com Upvote 0
[B4X] Use WebView to show large images Better to use: [B4X] HugeImageView - show very large images Depends on: XUI and JavaObject. 'xui is a global XUI object. Private Sub ShowImage(WV As WebView, Dir As String, FileName As String) #if B4A Dim jo As JavaObject = Me jo.InitializeContext 'comment this line if calling this... www.b4x.com
Duque Active Member Licensed User Longtime User Jul 10, 2021 #4 If it worked, thank you very much Upvote 0