Hi, I am using webview to display images stored in an internal directory (with an old activity application (not B4XPages)).
The problem is that there are images of many sizes and I would like them all to fit the screen size of the device.
Is this possible?
Thank you.
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Hi, this is the code I use to display the photo.
Thank you.
B4X:
Sub VerFoto
Dim cFoto, cDir, cExt, cImagePath As String
Dim mXui As XUI
'
cDir = globales.cDirFotosOriginales
cExt = globales.DBconex.ExecQuerySingleResult("select ftpTipoFotos from tbEmpresa limit 1")
cFoto = globales.cCodigoEmpresa & cCodigoArticulo &"."& cExt
'
If File.Exists( cDir, cFoto ) Then
Try
cImagePath = mXui.FileUri(cDir,cFoto)
Catch
Log(LastException.Message)
End Try
Else
cImagePath = mXui.FileUri(globales.cDirFotos,globales.cNoTieneFoto)
End If
'
wv1.LoadHtml($"<HTML><HEAD></HEAD><BODY><IMG SRC="${cImagePath}"></BODY></HTML>"$)
'
pnFoto.Visible = True
pnFoto.BringToFront
btCierra.BringToFront
End Sub