hi, i want to know how exactly to do this...
i take a picture from camera, then i put it in imageview (another activity) by calling CallSubDelayed2 with
bitmap type output.
the picture displayed ok in that activity.
i'm using cameraEx class and ImageMod Code Module for maintaining proportion in imageview
but i want to save that picture to SQLlite database with Blob Type.
how do i do that ?
note : i have read this thread , but i do not want to save the image to file.
https://www.b4x.com/android/forum/threads/sql-tutorial.6736/#post39108
thank you.
here are piece of code that i'm using
activity Camera
activity ac_podbyda, displaying image and save to database
i take a picture from camera, then i put it in imageview (another activity) by calling CallSubDelayed2 with
bitmap type output.
the picture displayed ok in that activity.
i'm using cameraEx class and ImageMod Code Module for maintaining proportion in imageview
but i want to save that picture to SQLlite database with Blob Type.
how do i do that ?
note : i have read this thread , but i do not want to save the image to file.
https://www.b4x.com/android/forum/threads/sql-tutorial.6736/#post39108
thank you.
here are piece of code that i'm using
activity Camera
B4X:
Sub Camera1_PictureTaken (Data() As Byte)
camEx.StartPreview 'restart preview
Dim in As InputStream
in.InitializeFromBytesArray(Data, 0, Data.Length)
Dim bmp As Bitmap
bmp.Initialize2(in)
CallSubDelayed2(ac_podbyda,"getphoto",bmp)
Activity.Finish
End Sub
activity ac_podbyda, displaying image and save to database
B4X:
Sub getphoto (byt As Bitmap)
Dim bmp As Bitmap = byt
Dim imgmodx As imgmod
imgmodx.Initialize
imgvphoto.Bitmap = imgmodx.FitBitmapToView(bmp,imgvphoto)
End Sub
B4X:
Dim ListOfMaps As List
ListOfMaps.Initialize
Dim inst As Map
inst.Initialize
inst.Put("image1", imgvphoto.Bitmap)
ListOfMaps.Add(inst)
DBUtils.InsertMaps(Starter.SQL1,"tt_photos",ListOfMaps)
Last edited: