Soon, I'll be asking for help in having a value clickable to bring up an image in my SQLite db.
Using code from: https://www.b4x.com/guides/B4XSQLiteDatabase/?page=25 I see that the code has the following:
I'm now creating a repository for my images. Shall I use the format of "GIF" for my images like in the code above, or would you suggest some other format like png, jpeg, Tiff, etc. I just noticed that my paint program makes a png image as default perhaps so that might be my number one choice.
Thanks,
Using code from: https://www.b4x.com/guides/B4XSQLiteDatabase/?page=25 I see that the code has the following:
Insert an image::
Sub InsertBlob
'convert the image file to a bytes array
Private InputStream1 As InputStream
InputStream1 = File.OpenInput(File.DirAssets, "smiley.gif")
Private OutputStream1 As OutputStream
OutputStream1.InitializeToBytesArray(1000)
File.Copy2(InputStream1, OutputStream1)
Private Buffer() As Byte 'declares an empty array
Buffer = OutputStream1.ToBytesArray
'write the image to the database
SQL1.ExecNonQuery2("INSERT INTO table2 VALUES('smiley', ?)", Array As String(Buffer))
End Sub
I'm now creating a repository for my images. Shall I use the format of "GIF" for my images like in the code above, or would you suggest some other format like png, jpeg, Tiff, etc. I just noticed that my paint program makes a png image as default perhaps so that might be my number one choice.
Thanks,
Last edited: