Sub ReadBlob(ImageName As String)
Dim Cursor1 As Cursor
Dim Buffer() As Byte
Dim IpSt As InputStream
Dim Bitmap1 As Bitmap
Cursor1 = SQL1.ExecQuery("SELECT * FROM table1 WHERE name = '" & ImageName & "' ;")
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
Next
Buffer = Cursor1.GetBlob("image")
IpSt.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
Bitmap1.Initialize2(IpSt)
IpSt.Close
ImageViewSQL.SetBackgroundImage(Bitmap1)
End sub
Let's say that you have a table with two fields, name and image. Name is the picture name and image is the bloob field with picture.
Then you can try:
B4X:Sub ReadBlob(ImageName As String) Dim Cursor1 As Cursor Dim Buffer() As Byte Dim IpSt As InputStream Dim Bitmap1 As Bitmap Cursor1 = SQL1.ExecQuery("SELECT * FROM table1 WHERE name = '" & ImageName & "' ;") For i = 0 To Cursor1.RowCount - 1 Cursor1.Position = i Next Buffer = Cursor1.GetBlob("image") IpSt.InitializeFromBytesArray(Buffer, 0, Buffer.Length) Bitmap1.Initialize2(IpSt) IpSt.Close ImageViewSQL.SetBackgroundImage(Bitmap1) End sub
You'll probably need to adjust code to Your needs, and don't forget to Dim and initialize ImageView.
'Cursor1 = SQL1.ExecQuery("SELECT * FROM table1 WHERE name = '" & ImageName & "' ;")
Cursor1 =ExecuteRemoteQuery("SELECT * FROM LOGO WHERE NOMBRE ='" & ImageName & "' ;",IMAGEN_LOGO)
Here's a small example.
Tested on the real device.