fredo Well-Known Member Licensed User Longtime User May 23, 2016 #1 An App of mine used the webview.CaptureBitmap method successful the last few years. It worked as expected even with contents longer than the webviews height. After changing the Manifest from "20" to Code: android:targetSdkVersion="21" the resulting Bitmap now has only the top visible part of the webview. According to this and this the result of capturebitmap is different now due to performance reasons. Is there something I can do to get the full webview content as a bitmap even with targetSdkVersion=21 and up?
An App of mine used the webview.CaptureBitmap method successful the last few years. It worked as expected even with contents longer than the webviews height. After changing the Manifest from "20" to Code: android:targetSdkVersion="21" the resulting Bitmap now has only the top visible part of the webview. According to this and this the result of capturebitmap is different now due to performance reasons. Is there something I can do to get the full webview content as a bitmap even with targetSdkVersion=21 and up?
Erel B4X founder Staff member Licensed User Longtime User May 23, 2016 #2 Call this sub from Activity_Create (before you load the layout): Code: Sub EnableSlowWebViewDocumentDraw Dim p As Phone If p.SdkVersion >= 21 Then Dim jo As JavaObject jo.InitializeStatic("android.webkit.WebView").RunMethod("enableSlowWholeDocumentDraw", Null) End If End Sub Upvote 0
Call this sub from Activity_Create (before you load the layout): Code: Sub EnableSlowWebViewDocumentDraw Dim p As Phone If p.SdkVersion >= 21 Then Dim jo As JavaObject jo.InitializeStatic("android.webkit.WebView").RunMethod("enableSlowWholeDocumentDraw", Null) End If End Sub
fredo Well-Known Member Licensed User Longtime User May 23, 2016 #3 Erel said: Call this sub from Activity_Create (before you load the layout): Code: Sub EnableSlowWebViewDocumentDraw Dim p As Phone If p.SdkVersion >= 21 Then Dim jo As JavaObject jo.InitializeStatic("android.webkit.WebView").RunMethod("enableSlowWholeDocumentDraw", Null) End If End Sub Click to expand... Thank you Erel! It worked. Upvote 0
Erel said: Call this sub from Activity_Create (before you load the layout): Code: Sub EnableSlowWebViewDocumentDraw Dim p As Phone If p.SdkVersion >= 21 Then Dim jo As JavaObject jo.InitializeStatic("android.webkit.WebView").RunMethod("enableSlowWholeDocumentDraw", Null) End If End Sub Click to expand... Thank you Erel! It worked.