Hello have nice day Google Extras works wonderful, please help me with this:
I try show image on infowindowpanel, but image not in assets
i have download this, but i can't show properly
Log show correct object img
but is not update image
in order second time open mark this show image properly.
Thanks
I try show image on infowindowpanel, but image not in assets
B4X:
Sub InfoWindowAdapter1_GetInfoContents(Marker1 As Marker) As View
' Return Null
' the default InfoContent will be used if this event Sub is not defined or if it returns Null
Log("InfoWindowAdapter1_GetInfoContents")
lblTitulo.Text=Marker1.Title
Dim rs As ResultSet
Try
rs = Starter.BaseSQL.ExecQuery("SELECT ID_Casino,Name,Adress,Lat,Lon,imagen,Feature FROM Casino WHERE ID_Casino =" & Marker1.Snippet )
If rs.NextRow Then
lblAdress.Text = rs.GetString("Adress")
If (rs.GetString("Feature").CharAt(0)="1") Then
lf0.TextColor = 0xFFF47940
Else
lf0.TextColor = 0xFFDFDFDF
End If
If (rs.GetString("Feature").CharAt(1)="1") Then
lf1.TextColor = 0xFFF47940
Else
lf1.TextColor = 0xFFDFDFDF
End If
If (rs.GetString("Feature").CharAt(2)="1") Then
lf2.TextColor = 0xFFF47940
Else
lf2.TextColor = 0xFFDFDFDF
End If
If (rs.GetString("Feature").CharAt(3)="1") Then
lf3.TextColor = 0xFFF47940
Else
lf3.TextColor = 0xFFDFDFDF
End If
If (rs.GetString("Feature").CharAt(4)="1") Then
lf4.TextColor = 0xFFF47940
Else
lf4.TextColor = 0xFFDFDFDF
End If
If (rs.GetString("Feature").CharAt(5)="1") Then
lf5.TextColor = 0xFFF47940
Else
lf5.TextColor = 0xFFDFDFDF
End If
Dim sImagen As String
Dim bImagen As B4XBitmap
sImagen = rs.GetString("imagen")
Log(sImagen)
If sImagen.Trim="" Then
bImagen = LoadBitmap(File.DirAssets,"noimage.png")
imgClub.Bitmap =bImagen
Else
If File.Exists(File.DirInternalCache,sImagen)Then
bImagen = LoadBitmapResize(File.DirInternalCache,sImagen,100dip,100dip,True)
imgClub.Bitmap =bImagen
Else
bImagen = LoadBitmap(File.DirAssets,"noimage.png")
imgClub.Bitmap =bImagen
DownImg (sImagen)
End If
End If
End If
Catch
Log(LastException.Message)
End Try
rs.Close
Return InfoWindowPanel
End Sub
i have download this, but i can't show properly
B4X:
Private Sub Download(sImage As String )
Dim job As HttpJob
job.Initialize("", Me)
job.Download("https://www.pokerlola.com/uploads/poker/" & sImage)
Log("https://www.pokerlola.com/uploads/poker/" & sImage)
Wait For (job) JobDone(job As HttpJob)
If job.Success Then
'save image
Dim out As OutputStream = File.OpenOutput(File.DirInternalCache, sImagen, False)
File.Copy2(job.GetInputStream, out)
out.Close
Dim pnl2 As Panel = InfoWindowPanel.GetView(0)
Dim imgC As ImageView = pnl2.GetView(0)
Log(imgC.Tag)
imgC.Bitmap = job.GetBitmapResize(100dip,100dip,True)
End If
job.Release
End Sub
Log show correct object img
but is not update image
in order second time open mark this show image properly.
Thanks