B4J Question convert PNG from staticmap Google to Base64

devpialkt

Member
Licensed User
Longtime User
Hi All,

Need help to convert PNG from staticmap Google to Base64 string

B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
   GetPNG (resp)
   StartMessageLoop
End Sub

Sub GetPNG(resp As ServletResponse)
   Dim job As HttpJob
   job.Initialize("",Me)
   job.Download2($"http://maps.googleapis.com/maps/api/staticmap"$ , Array As String("center","merlion+stue"  ,"size","640x480") )
   Wait For (job) JobDone(job As HttpJob)
   If job.Success Then
     resp.Write(  job.GetString  )  '<-- how to convert return to base64 string ??
   End If
   StopMessageLoop
End Sub

Thank You
 
Top