Android Question Load sql blob data and display image on html page

metrick

Active Member
Licensed User
Longtime User
Ok, spend amount of time searching, but couldn't get answered.
Codes to read data from sql:
Code: Copy
                  Dim Buffer() As Byte 'declare an empty byte array
                            Buffer = cur.GetBlob("Img")
                            Dim InputStm As InputStream
                            InputStm.InitializeFromBytesArray(Buffer, 0, Buffer.Length)

              Dim Bmp As Bitmap
              Bmp.Initialize2(InputStm)
              InputStm.Close

'tag to display img:
<img src=Bmp style="width:120px;height:120px;">
 
Upvote 0
As @DonManfred wrote you need to save it to a file:
Code: Copy
Dim out As OutputStream = File.OpenOutput(...)
out.WriteBytes(buffer, 0, buffer.length)
out.Close
You can save it to File.DirInternal.

Code: Copy
WebView.LoadHtml($"
<img src="file://${File.Combine(File.DirInternal, "1.png")}" style="width:120px;height:120px;"/>
"$)
 
Upvote 0
Back
Top