iOS Question How can I save a displayed image in a webview?

Jean Weets

Member
Licensed User
Longtime User
How can I save a displayed image in a webview like from maps.googleapis.com ?
https://maps.googleapis.com/maps/ap...arkers=size:mid|color:0xff0000|label:1|london

In B4A it's easy:
B4X:
Sub [B]WebView1_PageFinished[/B] (Url As String)
If grabpic Then
Timer1.Initialize("Pause",4000) '2.5 seconds
Timer1.Enabled=True
End If
grabpic = False
End Sub
Sub [B]Pause_Tick[/B]
Timer1.Enabled=False
Try
Dim btmp As Bitmap = WebView1.CaptureBitmap
Dim Out As OutputStream
Out = File.OpenOutput(TargetDir, "map.png", False)
btmp.WriteToStream(Out, 100, "PNG")
Out.Close
Button3.visible = True
Catch
Log(LastException)
End Try
End Sub

But in B4I WebView1.CaptureBitmap is not available.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…