What's the recommended way to get a BLOB (image) from SQLite.
I'm having zero success modifying this one approach that I found.
Am trying to port a working B4A sub to B4I.
Thanks in advance
I'm having zero success modifying this one approach that I found.
Am trying to port a working B4A sub to B4I.
B4X:
Sub BlobToImageView
resultSet4 = SQL1.ExecQuery("SELECT image FROM table1 WHERE rowID = " & resultSet4.GetInt("ID"))
Dim binimageR() As Byte, OtptR As InputStream
' Cursor1.Position = 0 ' Cursor and Position not used in B4I
resultSet4.GetInt("id") ' column with the id index
Log("2prntr NMBR pls = " & (myRowID))
binimageR = resultSet4.GetBlob("image") ' column with the image BLOB
OtptR.InitializeFromBytesArray(binimageR, 0, binimageR.Length)
BmpR.Initialize2(OtptR)
OtptR.Close
Dim outR As OutputStream = File.OpenOutput(File.DirLibrary, "4.png" , False) ' I know this is wrong
BmpR.WriteToStream(outR, 100, "JPEG") ' write the bitmap to the stream
outR.Close
resultSet4.Close
End Sub