I would like to read images from a stream coming from a blob image of an mssql db that I read with this code
Read image from database mssql:
Dim Buffer() As Byte 'declare an empty byte array
Dim InputStream1 As InputStream
Buffer = Cursor1.GetBlob("immagineblob")
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
'TEST OK
Dim img As Image
img.Initialize2(InputStream1)
ImageView1.SetImage (img)
InputStream1.Close
With SMM is it possible to read an image coming from an array or a database instead of a file or a url?
You can AddLocalMedia to add bitmaps directly to the media cache.
B4X:
SMM.AddLocalMedia("image key", img, "image/*")
Note that those images will not be removed from the cache so it will not work if the number of images is large.
The other option, which might be simpler and better, is to copy the bytes to temporary files (File.WriteBytes).