I am loading images from a SQLite table, BLOB field.
If there in NO BLOB present (field is NULL), I need to load a generic image from File.DirAssets.
I am using the following, but cannot understand how to load the generic image file into the Buffer:
If there in NO BLOB present (field is NULL), I need to load a generic image from File.DirAssets.
I am using the following, but cannot understand how to load the generic image file into the Buffer:
B4X:
Buffer = dbCursor.GetBlob("Image")
If Buffer = Null Then
Log("No Image In Table")
Buffer = File.DirAssets,"BookBlank.jpg"
End If
Dim InputStream1 As InputStream
InputStream1.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
Dim Bitmap1 As Bitmap
Bitmap1.Initialize2(InputStream1)
InputStream1.Close
IV.SetBackgroundImage(Bitmap1)