Spanish Grabar Imagenes en Sqlite

aviario

Active Member
Licensed User
Longtime User
Hola, alguien sabe como se pueden grabar imágenes en la base de datos sqlite?



un saludo
Paco
 

dhernandez

Active Member
Licensed User
Longtime User
Lo hice de esta manera...

B4X:
Dim InputStream1 As InputStream
        InputStream1 = File.OpenInput(File.DirRootExternal & "/" & "EXTIN" & "/" & "DCIM", Variables.CODOCR & DATE1 & ".png")
       
        Dim OutputStream1 As OutputStream
        OutputStream1.InitializeToBytesArray(1000)

        File.Copy2(InputStream1, OutputStream1)
           
        Dim Buffer() As Byte
        Buffer = OutputStream1.ToBytesArray

        'Guarda la imagen en la base de datos como bytes
        SQL1.ExecNonQuery2("INSERT INTO imagen VALUES(?, ?, ?)", Array As Object(Variables.HORA, Variables.CODOCR,(Buffer)))
 
Top